The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 07-02-2009
samnyc samnyc is offline
Registered User
  
 

Join Date: Jan 2009
Posts: 52
pls. help with appening a file

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.

Last edited by vgersh99; 07-02-2009 at 07:03 PM.. Reason: code tags, PLEASE!
Bits Awarded / Charged to samnyc for this Post
Date User Comment Amount
07-02-2009 vgersh99 added code tags - charged 10K bits 0