Tiny Core Linux

Off-Topic => Off-Topic - Tiny Core Lounge => Topic started by: manit123 on September 16, 2012, 10:56:38 AM

Title: incomplete line in bash
Post by: manit123 on September 16, 2012, 10:56:38 AM
Code: [Select]
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
>


This is annoying . ctrl+c did not help .

Title: Re: incomplete line in bash
Post by: Rich on September 16, 2012, 12:05:16 PM
Hi manit123
Yes, that can be annoying. Try  Ctrl-D
Title: Re: incomplete line in bash
Post by: manit123 on September 16, 2012, 12:08:35 PM

ctrL+d helps .
Reason was
> sh: syntax error: unexpected end of file (expecting "then")
Title: Re: incomplete line in bash
Post by: gerald_clark on September 16, 2012, 12:11:17 PM
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.