Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 05-23-2008, 02:48 PM   #1
Registered: Oct 2006
Distribution: Ubuntu
Posts: 65

Rep: Reputation: 15
What does this script command mean?

I am a noob. Have been trying to get an automatic wireless connection on Ubuntu 8.04. Have tried the HowTo's on the ubuntu forum. I have been able to manually connect to the internet. But couldn t get an automatic connection on boot.

Following instructions on the manual connection howto, I edited the /etc/rc.local and added the commands I used to get a manual connection. I rebooted, but no connection.

I noticed that the first line of /etc/rc.local is :
#!/bin/sh -e . I don't know what that is, but it didn't work for me. I did use chmod to give permissions

I was familiar with #!/bin/bash, so I commented out the other, and used what I was familiar with. And it worked.

So what is #!/bin/sh -e and why didn't it work for me?

Last edited by ubume2; 05-23-2008 at 05:47 PM. Reason: add
Old 05-23-2008, 03:12 PM   #2
Registered: Apr 2004
Distribution: Slackware 11.0, Gentoo
Posts: 252

Rep: Reputation: 31
From the man page:

-e Exit immediately if a command exits with a
non-zero exit status.
Old 05-23-2008, 03:35 PM   #3
Registered: Oct 2004
Location: Southeast, U.S.A.
Distribution: Fedora (Desktop), CentOS (Server), Knoppix (Diags)
Posts: 934

Rep: Reputation: 38
The line "#!/bin/sh" tells Linux what shell to use for execution of the script. In this instance, you're using the sh shell, which is actually an older variant of bash. Bash is compatible with sh, and is more extensible.

In many current distributions /bin/sh is actually a link to /bin/bash. Hence, when sh is called, bash is actually what you are running.
Old 05-23-2008, 03:38 PM   #4
Registered: Mar 2008
Posts: 236

Rep: Reputation: 37
Also if you try entering this into a text editor like gedit and then save the file, you'll notice it change colours which indicates that it is being recognized as the start of a shell script. You'd think the # would mean comment and disregard what follows but the ! negates that.


scripts, wireless

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
script command shan_nathan Linux - Security 1 01-07-2008 09:00 AM
Help on a command for a script. assasukasse Linux - Newbie 6 06-05-2006 09:36 AM
script command trasher Linux - Newbie 5 02-06-2006 07:20 AM
Command in shell script Grassie Coetzee Linux - Software 1 03-13-2005 12:42 PM
script 'exit' command kilobravo Linux - General 8 01-16-2003 04:24 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:44 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration