LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 12-29-2006, 12:07 AM   #1
sunlinux
Member
 
Registered: Feb 2006
Distribution: RHCL 5
Posts: 226

Rep: Reputation: 30
Angry command with shell script


How do we use execute linux commands as a bunch with shell script. I created following script to to set lan card setting but when i run it give error saying :
[root@mon shll]# ./net
./net: line 1: $: command not found
./net: line 2: $: command not found
./net: line 3: $: command not found
./net: line 4: $: command not found
./net: line 5: $: command not found
./net: line 6: $: command not found

My shell script :
$ cd /sbin
$ ./ifconfig ath0 up
$ ./iwconfig ath0 essid "private net work"
$ ./ifconfig ath0 192.168.10.79 netmask 255.255.255.0 up
$ ./iwconfig ath0 key 0af21bbbbb
$ ping 192.168.10.3

what to do to run all commands in a script ?
 
Old 12-29-2006, 12:12 AM   #2
penguiniator
Member
 
Registered: Feb 2004
Location: Olympia, WA
Distribution: SolydK
Posts: 442
Blog Entries: 3

Rep: Reputation: 60
It looks like you are including the prompt character in your commands. The prompt character is the dollar sign ($), which is being read as the command to execute by the shell. Get rid of it on all of the lines of your shell script.
 
Old 12-29-2006, 12:36 AM   #3
sunlinux
Member
 
Registered: Feb 2006
Distribution: RHCL 5
Posts: 226

Original Poster
Rep: Reputation: 30
Thumbs up

DO not Post I hv SOLVED IT...
 
  


Reply


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
Shell Script help or proper command jmikeneedham Linux - General 2 04-30-2006 02:25 PM
command from shell script notworking Grassie Coetzee Linux - Software 1 03-14-2005 05:39 PM
Command in shell script Grassie Coetzee Linux - Software 1 03-13-2005 12:42 PM
command not found (My shell script) Swift&Smart Linux - Software 3 05-16-2004 12:14 AM
Shell script login command? chup Linux - General 3 08-24-2003 07:43 PM


All times are GMT -5. The time now is 08:12 AM.

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