![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Read a file and search a value in another file create third file using AWK | King Kalyan | Shell Programming and Scripting | 11 | 06-19-2009 01:05 AM |
| Need help with awk - how to read a content of a file from every file from file list | tanit | Shell Programming and Scripting | 7 | 03-10-2009 05:19 AM |
| file size comparision local file and remote file | dba.admin2008 | Shell Programming and Scripting | 4 | 11-13-2008 05:57 PM |
| Reading a file and writing the file name to a param file. | thebeginer | UNIX for Advanced & Expert Users | 1 | 10-05-2007 05:38 PM |
| Reading file names from a file and executing the relative file from shell script | anushilrai | Shell Programming and Scripting | 4 | 03-10-2006 05:25 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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 |
|
|||||
|
Quote:
|
|
||||
|
This is what I did and it's working fine but curious to learn if I can do this in a different ways? Code:
#!/usr/bin/ksh DATE=`/usr/bin/date '+%m%d%y'` cp -p /etc/inittab /etc/inittab_$DATE cat "hobbit:234:once:/etc/rc.hobbit start" >> /etc/inittab Thanks. |
|
|||||
|
Quote:
.tools you should look at are maybe sed/ed/awk. but make sure to know the smaller and faster tools like grep/cut/>/>> and so on. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|