I have a file that lists filenames, each on it\'s own line, and I want to test if each exists in a particular directory. For example, some sample lines of the file might be
In Windows:
type file.txt >NUL 2>NUL if ERRORLEVEL 1 then echo "file doesn't exist"
(This may not be the best way to do it; it is a way I know of; see also http://blogs.msdn.com/oldnewthing/archive/2008/09/26/8965755.aspx)
In Bash:
if ( test -e file.txt ); then echo "file exists"; fi