Computing.Net > Forums > Unix > insert timestamp with sed

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

insert timestamp with sed

Reply to Message Icon

Name: Georg
Date: November 29, 2002 at 06:33:41 Pacific
OS: Kernle 2.4.19
CPU/Ram: PIIIm 1 GHz
Comment:

!/bin/bash
cd /usr/local/httpd/htdocs/php_diplom/shop
for file in *.php;
do date=$(date) ; sed "s/Letzte Änderung am: **.**.****/Letzte Änderung am: $date/" $file > $file
done

well, so far it works. but now i want sed to insert the "last modified date" of each $file
instead of the current timestamp "date". how can i achive this ?



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: insert timestamp with sed

pattern matching/replacing with sed www.computing.net/answers/unix/pattern-matchingreplacing-with-sed/6671.html

Problem with sed www.computing.net/answers/unix/problem-with-sed/3990.html

joining lines with sed www.computing.net/answers/unix/joining-lines-with-sed/6674.html