Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

script not running in bash, only runs when shell is set to ksh

NandinhoNov 13 2012 — edited Nov 13 2012
I have the following script that do not run on bash:

#!/bin/ksh
for dir in directory1/subdirectory /directory2/subdirectory
/directory3/subdirectory
do
echo "$dir $( du $dir |wc -l)"
done > ./message1
mailx -s "number of files" fretagi@mcel.co.mz < ./message1

But this script runs if I set shell to be ksh. I try to change the first line to #!/bin/bash, but the script does not work.

Any hints
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 11 2012
Added on Nov 13 2012
3 comments
676 views