I see no need to reset your PATH env var and then set vars pointing to the various binaries:
Code:
PATH=/home/cruser00/hand/Data
WC=/usr/bin/wc
AWK=/usr/bin/awk
CUT=/usr/bin/cut
BC=/usr/bin/bc
SED=/bin/sed
I doubt very much that /bin and /usr/bin is not in your PATH env var. It's much cleaner to leave $PATH as is and define a var for your data path:
Code:
dataPATH="/home/cruser00/hand/Data"
and then append $FILE_NAME to this:
Code:
if [ -f "$dataPATH/$FILE_NAME" ];
It also means you can call sed with:
instead of
I think that would make the code cleaner and a lot easier to read.
Also, since the shell uses all uppercase letters for it's env vars, it's always recommended that you use a different naming convention for your script vars. Instead of:
use
Code:
File_Name= # or
FileName=