I am trying to execute a script and its throwing "File Not Found" error. Below is my script
#!/usr/bin/ksh export ROOT_ENV=dev export ROOT_DIR=/files/$ROOT_ENV/windows/mp export SRC_DIR=$ROOT_DIR/mp1 mail_id='[email protected]' if [[ -e "$SRC_DIR"/*_PO ]] then echo "File exist" exit 0 else echo "File not found" exit 1 echo "Hello User, File does not exist in the "$SRC_DIR". Please place the file in the path : "$SRC_DIR" Thanks, Team " | mail -s "Warning: <"$ROOT_ENV="> <INFA> <PACK> FILE DOES NOT EXIST in path '$SRC_DIR'" $mail_id echo "File does not exist" fi done Appreciate if some one can help here. Thanks,
[[ -e "$SRC_DIR"/*_PO ]]isn't going to work as you expect. A glob expression can't be used in a context that expects only exactly one file.