running a simple command line tool

CJ Tres ctres at grics.net
Thu Feb 23 14:21:53 UTC 2012


On 02/23/2012 05:40 AM, Avi Greenbury wrote:
> CJ Tres wrote:
>
>> Running basic smoketest.
>> smoketest.sh: 12: [[: not found
>> smoketest.sh: 18: [[: not found
>> smoketest.sh: 26: function: not found
>> Error found.  Leaving run.11199 in place.
>> Unable to execute command: 'sh test.sh'
>
> This looks like it's down to a naughty developer :)
>
> [[ is a 'bashism' (so-called because it's something that exists in
> bash but not in the 'sh' that it's a development from).
>
> The command 'sh test.sh' passes the 'test.sh' script to 'sh' which is
> a shell. Normally and historically it's a link to /bin/bash but
> modern Ubuntus and Debians use dash instead (in the interests of
> speed). [[ doesn't work in dash, so the test script fails on that error
> and the install aborts.


Running echo $SHELL returns /bin/bash on this install - Natty.
Can't remember for sure but I may have changed the default since I was 
only just getting familiar with bash.

>
> It should be a simple fix - the invocation of that script should be
>
> bash test.sh
>
> rather than
>
> sh test.sh
>
>> So... a question.
>>   From my obvious lack of knowledge, would an understanding of bash
>> scripting help shed some light on my darkness in this case, or is it
>> perl I would need to better understand?
>
> Of scripting, bash would be more helpful here. Perhaps most useful
> would be experience installing Perl apps, but that's rather niche :)
>
> Really, this is less bash scripting and more simply using bash, but the
> easiest way to use bash is to automate it into scripts.


The man page mentions that. I plan to write something (eventually) to 
simplify running it - once I figure out what I need to know to do it.





More information about the ubuntu-users mailing list