In the previous post, I wrote about an shellscript that store some data in a directory whose name includes date info.
Here I modified it to be able to add an identifier after the date info
in the directory name. As shown in the following code, getopts
function? is used to receive -i
option. After analyzing the options,
shift
line is necessary, otherwise identifier is also counted as an
argument.
If you save this script as keep_results.sh
somewhere in your system,
you can use this as :
$ /path/to/keep_results.sh -i identifier file1 file2 file3 ...
to save file#
files into the directory whose name is like
results_160225_003814_identifier
.