Pretty new to shell script,
want to write script which checks if any file
.300 extension exists on
/exports/files on server 10.xx.xx.xx. If
*.300 exists, move file to
/exports/files/arch and send an email to
*.300 isn't found then do nothing.
I tried below suggestion:
#! /bin/bash for FILE in `ls /exports/files/*.300` do mv $FILE /exports/files/arch echo "$FILE moved" | mailx -s $FILE moved email@example.com done
When there is no files its erroring out saying
ls: cannot access /exports/files/*.300: No such file or directory. Is there any way to suppress this...