At 04:20 19.06.00 +0000, you wrote:
> > i wanted to replace ash with bash, why wouldn't it work?
>
>Um, bash is too stupid to handle:
>
> if [ ~`hostname` = ~6M ];then;NM=tomsrtbt;else;NM=`hostname`-tomsrtbt;fi
>
>Um, it looks like bash doesn't allow you do do if/then/else all on the
>same line...
It works, if you remove 2 semicolons:
if [ ~`hostname` = ~6M ];then NM=tomsrtbt;else NM=`hostname`-tomsrtbt;fi
Syntax for if/then/else from the bash manual:
if list; then list; [ elif list; then list; ] ... [ else list; ] fi
The if list is executed. If its exit status is zero, the then list
is executed. Otherwise, each elif list is executed in turn, and if its
exit status is zero, the corresponding then list is executed and the
command completes. Otherwise, the else list is executed, if present.
The exit status is the exit status of the last command executed,
or zero if no condition tested true.
Robert
--
There are two ways to write error-free programs. Only the third one works.