+ support for multiple input files
This commit is contained in:
@@ -8,7 +8,6 @@ if [ $# -lt 1 ]; then
|
||||
echo "usage: '$this_file_name [path_to_file]'"
|
||||
exit 1
|
||||
fi
|
||||
#input_file=$1
|
||||
input_files=( "$@" )
|
||||
|
||||
sync_dir_sym=/home/${USER}/syncDir
|
||||
@@ -17,10 +16,14 @@ sync_dir=${!syncdir_env_var} # '!' to use the name and not the value
|
||||
cwd=$(pwd)
|
||||
|
||||
# nifty for debugging:
|
||||
echo ${input_files}
|
||||
#echo ${input_files[@]}
|
||||
#echo ${sync_dir_sym}
|
||||
#echo ${sync_dir}
|
||||
#echo ${cwd}
|
||||
#echo
|
||||
|
||||
# loop through all files to delete
|
||||
for input_file in ${input_files[@]}; do
|
||||
|
||||
# if input file has not path specified
|
||||
if [[ ${input_file} != *"/"* ]]; then
|
||||
@@ -44,3 +47,5 @@ if [[ -f ${new_file} ]] || [[ -d ${new_file} ]] ; then
|
||||
else
|
||||
echo "error: unable to delete ${new_file}"
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user