What tools can I use to accomplish this?
I'm writing a shell script to analyze an inittab file. Here's a sample file:
init:3:initdefault:
ioin::sysinit:/sbin/ioinitrc >/dev/console 2>&1
tape::sysinit:/sbin/mtinit > /dev/console 2>&1
muxi::sysinit:/sbin/dasetup </dev/console >/dev/console 2>&1 # mux i
nit
stty::sysinit:/sbin/stty 9600 clocal icanon echo opost onlcr ixon icrn
l ignpar </dev/systty
brc1::bootwait:/sbin/bcheckrc </dev/console >/dev/console 2>&1 # fsck,
etc.
link::wait:/sbin/sh -c "/sbin/rm -f /dev/syscon; \
/sbin/ln /dev/systty /dev/syscon" >/dev/consol
e 2>&1
cprt::bootwait:/sbin/cat /etc/copyright >/dev/syscon # legal
req
sqnc::wait:/sbin/rc </dev/console >/dev/console 2>&1 # syste
m init
#powf:
owerwait:/sbin/powerfail >/dev/console 2>&1 # power
fail
cons:123456:respawn:/usr/sbin/getty console console # syste
m console
#ttp1:234
ff:/usr/sbin/getty -h tty0p1 9600 # UPS now using this port
#ttp2:234:respawn:/usr/sbin/getty -h tty0p2 9600
#ttp3:234:respawn:/usr/sbin/getty -h tty0p3 9600
#ttp4:234:respawn:/usr/sbin/getty -h tty0p4 9600
#ttp5:234:respawn:/usr/sbin/getty -h tty0p5 9600
ems1::bootwait:/sbin/rm -f /etc/opt/resmon/persistence/runlevel4_flag
ems2::bootwait:/sbin/cat </dev/null >/etc/opt/resmon/persistence/reboo
t_flag
ems3:3456:wait:/usr/bin/touch /etc/opt/resmon/persistence/runlevel4_fl
ag
ems4:3456:respawn:/etc/opt/resmon/lbin/p_client
ups::respawn:rtprio 0 /usr/lbin/ups_mond -f /etc/ups_conf
I want to read each line, and do various things, (i.e. ignore lines that begin with #)but what will send each line as an argument?