BASH alias not working...
cjwatson at ubuntu.com
Tue Jun 21 01:15:36 BST 2005
On Mon, Jun 20, 2005 at 08:06:05PM -0400, Byron Saltysiak wrote:
> I'd also put all the commands you want to run on separate lines and
> check the exit value of the important ones with $? instead of putting
> them all on one line with &&.
I agree that avoiding the 'foo && bar && baz && ...' kind of
construction is generally a good idea.
I wouldn't recommend quite the same alternative strategy, though. When
writing reliable scripts, using 'set -e' at the top of your script and
explicitly ignoring the exit status of the commands you don't care about
(using '|| true' or whatever) is better than relying on yourself to
notice when commands are important enough to need checking.
Colin Watson [cjwatson at ubuntu.com]
More information about the ubuntu-users