+ 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]'"
|
echo "usage: '$this_file_name [path_to_file]'"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
#input_file=$1
|
|
||||||
input_files=( "$@" )
|
input_files=( "$@" )
|
||||||
|
|
||||||
sync_dir_sym=/home/${USER}/syncDir
|
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)
|
cwd=$(pwd)
|
||||||
|
|
||||||
# nifty for debugging:
|
# nifty for debugging:
|
||||||
echo ${input_files}
|
#echo ${input_files[@]}
|
||||||
#echo ${sync_dir_sym}
|
#echo ${sync_dir_sym}
|
||||||
#echo ${sync_dir}
|
#echo ${sync_dir}
|
||||||
#echo ${cwd}
|
#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 has not path specified
|
||||||
if [[ ${input_file} != *"/"* ]]; then
|
if [[ ${input_file} != *"/"* ]]; then
|
||||||
@@ -44,3 +47,5 @@ if [[ -f ${new_file} ]] || [[ -d ${new_file} ]] ; then
|
|||||||
else
|
else
|
||||||
echo "error: unable to delete ${new_file}"
|
echo "error: unable to delete ${new_file}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user