Re: Most Perplexing

2011-08-28 Thread Bob Proulx
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


signature.asc
Description: Digital signature


Re: Most Perplexing

2011-08-28 Thread Chris Brennan
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)



0xD5B20C0C.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature