[Nottingham] Bash files

Graeme Fowler graeme at graemef.net
Fri Feb 20 00:13:08 UTC 2009


Hi

On Thu, 2009-02-19 at 20:54 +0000, Ron Wilton wrote:
> I'm wanting to do a bash file, i.e. starting with
> 
> #!/bin/bash
> 
> I know what I want to put in it, but I can't remember where to put it.

Ummm...

Errr...

Well you got the main bit right (ie. that script has an environment line
in it) but... the next bit? That depends on what you want it to do!

In the classic BASIC vein (I'd do "10 print name; 20 goto 10" but goto
is an abomination as generations of Comp Sci students have instructed
me!)... and choose your editor (mine is vi):

[user at machine ~]$ vi script
#!/bin/bash
echo "I know... but I can't remember..."
sleep 10
exit
:wq

[user at machine ~]$ ./script

...or...

[user at machine ~]$ sh script

What is it you're trying to do?

Graeme




More information about the Nottingham mailing list