3 Replies Latest reply: Nov 13, 2012 2:12 PM by bigdelboy RSS

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

    Nandinho
      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