On Wed, Jan 23, 2002 at 01:51:50PM -0600, JW wrote:
> 
> if [ -n `mount |grep "/mnt/root/cschomeserver/e"` ] #if it's already mounted don't 
>mount it
> 
> fluorite:~ # ./test.sh
> ./test.sh: [: too many arguments

The problem in your script is that the result of the command in backquotes is
put as is by bash where it is. Thus you end up with something like

if [ -n server:/mnt/root on /mnt/root/......... ]

This is an incorrect syntax for [ -n ]. ( [ -n server:/mnt/root ] should be
fine, but here you have too many arguments). The solution given in the other
mail should be fine, you can test the error status of grep.

Pat



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to