Unix cannot delete file with Bash script

Viewed 239

I cannot delete file from bash file, if I type command directly in command line then is OK, otherwise if I try to run command inside bash file it's look like is OK but file is never deleted.

So, command: rm -f /folder/folder/folder/file_name

If I run this in bash file let say delete.sh:

!/bin/sh
echo ============== DELETING START ==============
rm -f /folder/folder/folder/file_name
echo ============== DELETING END  ================
echo DELETING RESULT:: Success
status=$?
echo Script execution status:: $status

File was never deleted like it's not possible to delete file from bash file. Any tips.

0 Answers
Related