FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 08-28-2011, 11:48 PM
Chris Brennan
 
Default Most Perplexing

On 8/28/2011 6:43 PM, RiverWind wrote:
>
> Hey There,
>
> Well folks, in order to run the conversion suggested by Bob, I did
> the following.
>
> I first saved the script he outlined and called it cb.sh. I then
> tried to make the file executable with "chmod +x cb.sh". I then ran
> the file with "./cb.sh". I got the following response.
>
> Quote On
> [workshop] $ ./cb.sh
> '/cb.sh: line 1: syntax error near unexpected token `do
> '/cb.sh: line 1: ` for chapternum in $(seq 1 45); do
> [workshop] $
> Quote Off
>
> I am sure that I have done something wrong, but I can't figure for
> the life of me just what it was.
>
> cheerio,
> Riv
>
> The script reads as follows.
>
> for chapternum in $(seq 1 45); do
> wget http://www.dsl.org/cookbook/cookbook_$chapternum.html
> done
>
>
> Feel free to visit my website and my blog and learn more about me
> and what I stand for.
> My Website @ http://riverwind.shellworld.net
> My Blog http://windraven13.livejournal.com/
>
>
Put this on line one of your little script

#!/usr/bin/env sh

save it and rerun it. This will tell the script what shell to use to
execute the commands.


--
> Chris Brennan
> --
> A: Yes.
> >Q: Are you sure?
> >>A: Because it reverses the logical flow of conversation.
> >>>Q: Why is top posting frowned upon?
> http://xkcd.com/84/ | http://xkcd.com/149/ | http://xkcd.com/549/
> GPG: D5B20C0C (6741 8EE4 6C7D 11FB 8DA8 9E4A EECD 9A84 D5B2 0C0C)
------------------------------------------------------------------------
 
Old 08-29-2011, 01:32 AM
Bob Proulx
 
Default Most Perplexing

Chris Brennan wrote:
> RiverWind wrote:
> > Well folks, in order to run the conversion suggested by Bob, I did
> > the following.
> >
> > I first saved the script he outlined and called it cb.sh. I then
> > tried to make the file executable with "chmod +x cb.sh". I then ran
> > the file with "./cb.sh". I got the following response.

What shell do you normally use for the command line?

> Put this on line one of your little script
>
> #!/usr/bin/env sh
>
> save it and rerun it. This will tell the script what shell to use to
> execute the commands.

Alternatively run it explicitly using 'sh'.

sh ./cb.sh

That will invoke /bin/sh and pass it the filename to run. Doing it
this way avoids the need to make it executable. It explicitly calls
the right interpreter upon the file.

Bob
 

Thread Tools




All times are GMT. The time now is 02:52 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org