Go Job Hunting at the LQ Job Marketplace
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 04-13-2007, 09:02 PM   #1
Registered: Jul 2006
Posts: 130

Rep: Reputation: 15
Write a script to run several commands ???


I am using fedora distribution. There are few commands i have to enter to for a project involved such as below:

# echo 0 > /proc/sys/net/ipv6/conf/eth0/forwarding
# echo 1 > /proc/sys/net/ipv6/conf/eth0/autoconf
# echo 1 > /proc/sys/net/ipv6/conf/eth0/accept_ra
# echo 1 > /proc/sys/net/ipv6/conf/eth0/accept_redirects

May I know is there possible to write a script to run the several commands in terminal if I don't want type the command line by line?

If yes, can you tell me how to do so? Because I have never do so before.

Thank you.
Old 04-13-2007, 09:20 PM   #2
Registered: Oct 2004
Location: Southeast, U.S.A.
Distribution: Fedora (Desktop), CentOS (Server), Knoppix (Diags)
Posts: 934

Rep: Reputation: 38
Just copy those lines into a new file, removing the leading #.
then use chmod +x to give it execute permission.

That should be about it.


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
Run bash commands script as cron anjanesh Linux - General 4 04-03-2007 07:25 AM
Help to create a script to open a terminal and run commands in it. Brian1 Linux - Software 6 02-07-2005 07:46 PM
Script to Run the Same Commands on a List of Files Chryzmo Programming 1 10-03-2004 09:34 AM
Creating a script to run two commands anjaan Programming 11 06-15-2004 03:51 AM
run 2 commands in a script ddpicard Linux - General 10 06-13-2003 05:50 PM

All times are GMT -5. The time now is 06:19 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