WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: incomplete line in bash  (Read 2837 times)

Offline manit123

  • Sr. Member
  • ****
  • Posts: 315
incomplete line in bash
« 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 .


Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: incomplete line in bash
« Reply #1 on: September 16, 2012, 12:05:16 PM »
Hi manit123
Yes, that can be annoying. Try  Ctrl-D

Offline manit123

  • Sr. Member
  • ****
  • Posts: 315
Re: incomplete line in bash
« Reply #2 on: September 16, 2012, 12:08:35 PM »

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

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: incomplete line in bash
« Reply #3 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.