You might try this:
sed 's/\(^au00.*\)\(:off:\)\(.*\)/\1:respawn:\3/' /tmp/inittab.tmp
--Joe
-----Original Message-----
From:        Chris Fowler [SMTP:">chrisf@computone.com]
Sent:        Tuesday, January 04, 2000 5:55 PM
To:        '">ale@ale.org'
Subject:        [ale] SED question
I'm trying to edit /etc/inittab and need to use sed. I have a question.
How can I use sed to change off to respawn in only on occurence in this
file.
Below is an exapmle
au00:234:off:/etc/getty /dev/ttyg00 m
au01:234:off:/etc/getty /dev/ttyg00 m
if I do the following:
cat /etc/inittab | sed s/off/respawn > /tmp/inittab.tmp ; mv
/tmp/inittab.tmp /etc/inittab
then it will replace all occurence of off.
How can I cahnge the above statement to change it on the line that just has
au00
Thanks,
Chris
--
To unsubscribe: mail ">majordomo@ale.org with "unsubscribe ale" in message body.
--
To unsubscribe: mail ">majordomo@ale.org with "unsubscribe ale" in message body.