Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 14th April 2007, 02:02 AM
wahaha Offline
Registered User
 
Join Date: Jul 2006
Posts: 93
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.
Reply With Quote
  #2  
Old 14th April 2007, 03:05 AM
Dies Offline
Registered User
 
Join Date: Oct 2006
Posts: 4,752
Just make a new text file :
Code:
#!/bin/bash

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
Name it whatever you want, you can use a .sh extension so you know it's a shell script but you don't have to. Then make the file executable:

chmod +x <whatever you named it>

When you want to run it just do

./<whatever you named it>

here's couple of good sites:

http://www.lowfatlinux.com/linux-shell-script.html

http://www.tuxfiles.org/
Reply With Quote
  #3  
Old 14th April 2007, 09:00 AM
markkuk Offline
Registered User
 
Join Date: Apr 2005
Location: Finland
Posts: 5,076
You don't need a separate script to set kernel parameters in /proc/sys. Add the parameters and values in /etc/sysctl.conf. See "man 8 sysctl" and "man 5 sysctl.conf".
Reply With Quote
Reply

Tags
commands, run, script, write

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
send AT commands in a shell script messner Servers & Networking 5 11th December 2012 11:01 AM
Kmail in Gnome: Can't Type, Write, or Use Key Commands jdrouin Using Fedora 3 30th March 2009 01:16 AM
How to write commands for Linux? tech291083 Using Fedora 3 27th November 2008 01:18 PM
How to Write commands in a C Program? AbubakarMalik Using Fedora 0 4th January 2008 02:43 PM
How to execute two commands in a gnome-terminal without a script? Pinn2 Using Fedora 10 28th August 2007 06:35 PM


Current GMT-time: 03:13 (Thursday, 23-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat