Results 1 to 4 of 4
OK, I've created a sh file to delete a cache folder for one of my sites. Basically, the bash looks like this:
Code:
#!/bin/bash
rm -fdr cached*
mkdir cached
chmod ...
- 10-05-2009 #1
Bash file problem
OK, I've created a sh file to delete a cache folder for one of my sites. Basically, the bash looks like this:
When I launch it within the console (root), it does not delete the cached folder and when I "ls -l", I always find another folder called "cached\r".Code:#!/bin/bash rm -fdr cached* mkdir cached chmod 0777 cached
The cached folder has 0777 permissions all the time, owner root, group root.
The funny part is, I have another site, on the same server, different account and this bash works perfectly.
If I run the commands individually from the console, works perfectly...
I'm puzzled
- 10-05-2009 #2
- 10-05-2009 #3
no..i launch the script with the "sh file.sh" command.
the sh file is in root with all the folders, including "cached"
- 10-06-2009 #4
Try running the script with sh -x
sh -x file.sh
This will output the process to the console so it can be checked for errors.
or run diff to compare the two script.
diff /path/to/working/script path/to/non-working/script


Reply With Quote
