Ignatius Posted October 13, 2009 Posted October 13, 2009 I'm a Linux-noob and am almost embarrassed to ask this. I've been playing around with various Live CDs and always start my session with a series of commands to set the IP address, DNS, DG and a few other things. I know that I can use DHCP but I like to use static addresses. I know that I can create a batch file in Windows to replicate a series of commands at the command prompt, but is there anything similar in Linux? If so, I'd plan to create the file and save it either to a flash drive or on the hard drive of the laptop upon which I'm running the Live CD so it would be easy to pick up at the beginning of the session, run it, and my configuration would be set. If this isn't possible, I guess I could copy/paste the commands from a text file to set the configuration that I want. As I say, I'm to ask such a low level question.
kesomir Posted October 13, 2009 Posted October 13, 2009 Bash Scripting http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html Advanced Bash-Scripting Guide http://www.linuxconfig.org/Bash_scripting_Tutorial 2
kmount Posted October 13, 2009 Posted October 13, 2009 Shell scripting depending upon which shell you have but a popular one is Bash as Kesomir has provided some good links to. An example: #!/bin/bash ifconfig eth0 inet 192.168.1.34 netmask 255.255.255.0 route add default gw 192.168.1.1 echo "nameserver 192.168.1.3" > /etc/resolv.conf echo "nameserver 192.168.1.4" >> /etc/resolv.conf export http_proxy="http://proxy.mysite.com:80" export ftp_proxy="http://proxy.mysite.com:80" 1
Ignatius Posted October 13, 2009 Author Posted October 13, 2009 Perfect, that's just what I want ... some "buzz words" to research!
llawwehttam Posted October 18, 2009 Posted October 18, 2009 (edited) Personally I use sh for this purpose in vim. Theres nothing easier than vim program.sh ..... sh program.sh or you can chmod -x program.sh ./program.sh Edited October 18, 2009 by llawwehttam
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now