Off-Topic > Off-Topic - Tiny Core Lounge

incomplete line in bash

(1/1)

manit123:

--- Code: ---tc@box:/mnt/sdc1/startup$ df | grep -i ossxmix ; echo $? ; if [ $? == '1'] then echo ossxmix not found else ossxmix found fi
>
> /
> '
> ?
>
>
>
>
>
>
>
> ;
> $
> ?
> "
> "
> ''
> '
>
>
>
>
> \
> //
> \n
> '
>
> /
> end
> endif
> exit
> quit
>


--- End code ---

This is annoying . ctrl+c did not help .

Rich:
Hi manit123
Yes, that can be annoying. Try  Ctrl-D

manit123:

ctrL+d helps .
Reason was
> sh: syntax error: unexpected end of file (expecting "then")

gerald_clark:
You have several errors in that line.
1. You are testing the return code of echo, not grep.
2. You are missing a ';' before then, else, and fi.

Navigation

[0] Message Index

Go to full version