/bin/bash and /bin/ksh doesen't work also.
When I save the following line appears: warning: commands will be executed using /usr/bin/sh
So I think my script uses the sh shell, but if I run the script with /usr/bin/sh /home/tes/ausgabescript.sh I will got a syntax error in the line of creating an array.
Does someone know how I can execute my script via bash? If I run my script normaly on the bash-shell, everything works fine.
There is no need of specifying the /usr/bin/bash in the crontab entry. Instead of that you can give sh simply. So it will automatically execute the sh command from where the sh command is located. (/usr/bin/sh)
If #!/usr/bin/bash is already the first line of your script, just be sure its executable!
There is nothing more to do ( and no it is not executed by sh since this first line means:
open a new shell - This one (bash) to execute the following lines...)
warning: commands will be executed using /usr/bin/sh
just means that any commands you specified in the crontab are run by passing them to sh -c. So your command will be run similar to
sh -c '/usr/bin/bash /home/tes/ausgabescript.sh'
If that works, so will your command.
The warning is IMO a historical remnant from the time when users actually tried to program using the C Shell, which has a very different syntax from the Bourne/Korn Shell
Omg it's absolutely mysterious your command is also working without a problem. Now I renamed my script, an now crontab work with the script. But not right. There is a if-else-tie and crontab works only with the true part.
I don't understand why.
---------- Post updated at 05:06 AM ---------- Previous update was at 04:49 AM ----------
sry sry sry i found my fault.
I used aliases in my script, so with bash on the console it worked. But with crontab there are no aliases available.
bash-4.0.033#sept 2009
But what does it bring more compared to hpux standard ksh?
I certainly would not use it for administration tasks...(compatibility purpose for a start...)