Forum Moderators: bakedjake
cp `ls SRCDIR ¦ grep -v '^BADFILE$'` TARGETDIR b) If you want to make sure you can handle arbitrary numbers of files, but don't care quite as much about raw performance, then you can loop over the files in the source directory; and copy them one by one.
In [t]csh:
foreach f in ( SRCDIR/* )
if ( "${f}" == "BADFILE" ) then
; # do nothing
else
cp SRCDIR/${f} TARGETDIR
endif
end
In [ba]sh:
for f in SRCDIR/*; do
if [ "${f}" == "BADFILE" ] ; then
; # nothing
else
cp SRCDIR/${f} TARGETDIR
fi
done;
Please test on some non-critical data before blaming me for any failures... ;)