October 3rd, 2003, 03:25 PM
Join Date: Oct 2003
Time spent in forums: < 1 sec
Reputation Power: 0
Unix Script cannot copy filename with brackets
i am trying to write a bash script to backup recent files from a directory.
it works well, except that it does not copy files whose names have brackets.
any advice on how i might be able to do this, or on code that would find and rename such files before i run my copy script?
# this script will backup all files from the last month to a secondary location
# mkdir backup_$date
find . -mtime 1 | \
while read file
#avoiding pesky trivial output
if [ "$file" = "." ]
cp "$file" /Volumes/192.168.1.108/ScriptTest/backup_$date/"$file"