Which shell is the best in startup scripts?
Posted on 2005-04-05
I am using Linux version from 2.2.4 to 2.4.29.
This question is about scripts in /etc/rc.d.
I've noted that they have first line #!/bin/sh
Does this mean that they invoke C-Shell?
If so, can I use Bash syntax in them? Probably not..
If I want to use, Bash syntax anyway, will them work if I change
first line to #!/bin/bash. In other words, will be Bash invoked on my machine
If by some reason there are some considerations against
using Bash in startup scripts, were to find
manual which highligts differences between Bash and C-shell?
In other words what is a strategy to write safe but effective scripts?
For example, if I have a script:
X=`cat moo | sed -n ' /d/d' `
Can I change the first line to