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.
Shell scripting depending upon which shell you have but a popular one is Bash as Kesomir has provided some good links to.
Code:#!/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"
Ignatius (13th October 2009)
Perfect, that's just what I want ... some "buzz words" to research!
Personally I use sh for this purpose in vim.
Theres nothing easier than
or you can
chmod -x program.sh
Last edited by llawwehttam; 18th October 2009 at 01:23 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)