![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Perl: Extracting date from file name and comparing with current date | MKNENI | Shell Programming and Scripting | 4 | 03-26-2008 04:01 PM |
| check the current date file in directory | pallvi | SUN Solaris | 2 | 01-04-2008 05:57 PM |
| how to check whether the given file is 5 weeks older than current date | risshanth | Shell Programming and Scripting | 1 | 10-29-2007 04:53 AM |
| File date vs Current date | trexlim | Shell Programming and Scripting | 4 | 05-04-2007 09:35 PM |
| how to give current date in file name? | simurg11 | UNIX for Dummies Questions & Answers | 3 | 05-10-2005 09:09 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
How to write current Date dynamically in a file
Hi,
I have a requirement where I need to write the current date to the file. This remaining content of this file does not change and we use this file to concat with another one. Only thng is that I need to write the date to say, record number 10 of this file everyday. Can this be done in my ksh. e.g AADjndfj dweced dew dswhdx CURRENT DATE xndxwdxew cdfcedc dcfecf dcfdwq Appreciate your responses. Thanks, Sree |
|
||||
|
Code:
sed "s/CURRENT DATE/`date`/" file >temp mv temp file If you want to include after particular line Code:
sed "10 i\\ `date`" file > temp mv temp file |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|