Usually putting the entire file name/path in single quotes handles the special characters. i don’t think there would be anything different about character handling for bsa – you’d be limited by whatever zsh could do here (I’m assuming you’d be scripting it) ?
Or just delete the parent directory the files are in ?
How do you know what files to delete ?
Hey Bill seems you and I are doing a lot of chatting today HA HA!
You would think the single quotes would handle it but alas they are not for whatever reason. Every time I hit anything extended (@%&#) I have to go in and escape it by hand. Then you have the case of people actually using ' in their path/filenames which just adds another level of problem.
I cannot blow the directory away as everything in the path may not be of a non-compliant state. We are only looking for/deleting files that have a mtime older than +5 and then only blowing away type f not d.
We are running a really simple find and pushing that to a file (find /sftp/home -type f -mtime +5 > /tmp/remove) then I execute a loop that reads that in to blow stuff away or I will just do it all in a for loop on the command line. Everything is done by a person at this time and is kinda a pain.
1 of 1 people found this helpful
you could escape on the fly...
echo "@$%"|sed -e 's/@/\\@/g;s/$/\\$/g;s/%/\\%/g'
this seems to be a shell scripting question - have you searched stackoverflow and such ? i'm sure this is a pretty common problem.
whenever you figure out the scripting bits then just throw that in a nsh script job (type 3 for non-nsh scripts) and run against the target.
I think I may have it now, thanks all for the advice.
Does your issue fixed ? If yes, mark it answered along with your fix.