LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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-28-2006, 11:07 PM   #1
sunlinux
Member
 
Registered: Feb 2006
Distribution: RHCL 5
Posts: 239

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-28-2006, 11:12 PM   #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-28-2006, 11:36 PM   #3
sunlinux
Member
 
Registered: Feb 2006
Distribution: RHCL 5
Posts: 239

Original Poster
Rep: Reputation: 30
Thumbs up

DO not Post I hv SOLVED IT...
 
  


Reply



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 01:25 PM
command from shell script notworking Grassie Coetzee Linux - Software 1 03-14-2005 04:39 PM
Command in shell script Grassie Coetzee Linux - Software 1 03-13-2005 11:42 AM
command not found (My shell script) Swift&Smart Linux - Software 3 05-15-2004 11:14 PM
Shell script login command? chup Linux - General 3 08-24-2003 06:43 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:42 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
Open Source Consulting | Domain Registration