need help with time stamp script
Hi,
I had to recover log files from a rescue disk, and now all the 1238 files have the same time stamp. I wanted to sort them in chronological order so that I can manage them more better. The files span from 2004-2009 and are of the form log_102404.txt log_020407.txt log_010209.txt I am trying to get a BASH script going to sort and time stamp them at the same time using the 'touch -m' option, but that did not go so well. Code:
for f in (ls -t /file/directory) So I am a bit of stuck in the mud. Even though I can get a file list as a Perl array, but can't seem to get 'touch' to accept the file descriptors. 'touch' is complaining of indigestion "touch missing file operand." I am now ripe for a kind suggestion. Regards, bufo |
See if the script is running the commands you think it is and then try running that exact same command at the command line
Code:
for f in (ls -t /file/directory) |
Quote:
Code:
log_102404.txt Code:
cat file_list.txt|while read FILENAME; do |
Thanks for the suggestion unSpawn. I developed the idea a bit using a control script as input. This can be improved a bit further.
Code:
#!/bin/bash With kind regards, bufo |
All times are GMT -5. The time now is 07:25 AM. |