Originally Posted by Disillusionist
PS the script and the directory it lives in needs to have read and execute permissions for any of the users who will run this script.
If the script is called backup.sh you need to run:
chmod 755 backup.sh
If the directory is /home/testDir, then:
chmod 755 testDir
Additionally, why are you (as users) having to backup your own files?
This is normally a part of the Systems Administrators work.
Great! These are great pointers.
True. This ideally needs to be done by a sys admin. But I was just asked to come up with a script that can fix some string issues that got introduced through another processor.
So, I created the script.
This script creates some temp files.
It also overwrites/updates the 'processed' files to fix errors, typically passed as command line arguments by a user.
What I wanted to be able to do is following:
1. First backup any of the files that need to be fixed.
2. Allow the script to fix the files.
3. Quietly delete/remove the temp files that my script creates.
All this needs to happen in the user's local dir.