Page 1 of 1 [ 6 posts ] 

jamiethesilent
Raven
Raven

User avatar

Joined: 11 Jul 2010
Age: 30
Gender: Male
Posts: 100
Location: Mid Wales.

20 Nov 2010, 3:58 am

Does anyone on this forum now how to execute command from a shell script. I know the basic CLI stuff. adduser, removing/creating files etc. But i cannot find a good website for basic bash shell script punctuation. Once i have typed the header: #!/bin/bash I don't know how to tell the script the next line is a command, i.e lpr test.vt etc. Can anyone help with this?

James


_________________
If we knew what it was we were doing, it would not be called research, would it?
-Albert Einstein

- Cruch Bang Linux.


mcg
Veteran
Veteran

User avatar

Joined: 26 Jan 2010
Age: 36
Gender: Male
Posts: 538
Location: Sacramento

20 Nov 2010, 12:13 pm

You don't need to:

Code:
#!/bin/bash
lpr test.vt


If it's not a BASH keyword then it's assumed to be an external command.

http://tldp.org/LDP/abs/html/index.html



Jono
Veteran
Veteran

User avatar

Joined: 10 Jul 2008
Age: 45
Gender: Male
Posts: 5,677
Location: Johannesburg, South Africa

20 Nov 2010, 12:41 pm

jamiethesilent wrote:
Does anyone on this forum now how to execute command from a shell script. I know the basic CLI stuff. adduser, removing/creating files etc. But i cannot find a good website for basic bash shell script punctuation. Once i have typed the header: #!/bin/bash I don't know how to tell the script the next line is a command, i.e lpr test.vt etc. Can anyone help with this?

James


By Zubuntu, don't you mean Xubuntu?



jamiethesilent
Raven
Raven

User avatar

Joined: 11 Jul 2010
Age: 30
Gender: Male
Posts: 100
Location: Mid Wales.

22 Nov 2010, 3:27 am

Yes. Its just it is just I heard it pronounced like that so I spellt it like that.

I have made my first few scripts. Playing with rad and test commands. Can anyone pint me (so to speak) to a good text based web browser?

James.


_________________
If we knew what it was we were doing, it would not be called research, would it?
-Albert Einstein

- Cruch Bang Linux.


StuartN
Veteran
Veteran

User avatar

Joined: 20 Jan 2010
Age: 62
Gender: Male
Posts: 1,569

22 Nov 2010, 11:40 am

jamiethesilent wrote:
But i cannot find a good website for basic bash shell script punctuation.


This guide to Bash and scripting is good - http://tldp.org/LDP/Bash-Beginners-Guide/html/

You can also type "man command" into Google to get useful help about Bash commands, and sometimes easier than in the terminal (and in the terminal, use "/string" to search for a "string" in within man pages).



Orwell
Veteran
Veteran

User avatar

Joined: 8 Aug 2007
Age: 36
Gender: Male
Posts: 12,518
Location: Room 101

22 Nov 2010, 12:22 pm

jamiethesilent wrote:
Can anyone pint me (so to speak) to a good text based web browser?

Elinks is the best, I think.

sudo aptitude install elinks


_________________
WAR IS PEACE
FREEDOM IS SLAVERY
IGNORANCE IS STRENGTH