Results 1 to 2 of 2
Hi,
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 ...
- 04-14-2007 #1Just Joined!
- Join Date
- Jul 2006
- Posts
- 70
Write a script to run several commands ???
Hi,
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.
- 04-14-2007 #2
Easy (I hope I'm not answering a home work question). Write those commands into a text file and save it. Then execute the following at the command line,
Obviously replace "filename" with whatever you called the file.Code:chmod +x filename
If you want to execute the file, navigate to the directory where you saved the file, and type the following to execute all those commands(Including the . at the start).Code:./filename
Registered Linux user #388328 || Registered LFS user #15880
AMD 64 X2 4600+ :: 2X1GB DDR2 800 :: GeForce 9400 GT 512MB :: ASUS M2N32 Deluxe :: 4X250GB SATAII
Need instant help? Try us on IRC -- #linuxforums on freenode


Reply With Quote