I have several scripts, to process text files e.g. remove several
lines, modify part of them and so on.
I usually do this in a csh-loop, e.g.
foreach file ($*)
grep -v 'bad_regex' $file > /tmp/$$
mv /tmp/$$ $file
end
Or at least with a few checkings.
I will get the right result, but the original file date will get lost
and all files processed this way will have the date set to the
actual date, because of the redirection and the move command.
I would like to keep the date of the files to the original date,
for this information is more worth then the date I have run the
script on the files.
Is this a simple problem, for I only can think of a kind of
'/ls the date into a textfile, use touch after processing
the old file on the newly created file' procedure ?
Sincerly Christopher
Maybe a C function would be able to do so,
e.g.
main(){
date=...
system(file)
redate(file)
as a rough draw I can imagine offQuote:}
--
----------------------------------------------------------------------
>> || Pharmazeutisch-Chemisches Institut | .._.. | <<
>>> / \ Universitaet Heidelberg |_______| <<<
>> /____\ GERMANY /______/ <<