Quote:
Originally Posted by samnyc
Hi,
I wrote a script, but it's not working. Please advise. I want to add the text at the end of the file. Should I use sed or awk. Not sure any thing is fine with me.
Code:
#!/usr/bin/ksh
DATE=`/usr/bin/date '+%m%d%y'`
cp -p /etc/inittab /etc/inittab_$DATE
sed's/$/"hobbit:234:once:/etc/rc.hobbit start"/g' /etc/inittab
Thanks.
|
you want to add at the end of the file or the at the end of last line of the file??