![]() |
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 |
| Problem with Tail command --urgent pls | subbukns | Shell Programming and Scripting | 4 | 09-21-2006 12:29 PM |
| tail command.. | amon | Shell Programming and Scripting | 2 | 06-02-2006 05:36 AM |
| tail command | whatisthis | Shell Programming and Scripting | 3 | 03-31-2005 10:34 AM |
| help with !(tail -2) command.. using pipes | sdlayeeq | UNIX for Advanced & Expert Users | 8 | 02-17-2005 03:46 AM |
| tail command in SUN & HP_unix | clemeot | UNIX for Dummies Questions & Answers | 3 | 05-08-2002 12:31 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
tail command and timestamp
Hi all ,
I am using the following code to get the files from a directory Code:
ls -lrt A*.txt | tail -1 | awk '{print $9}' | read fname
Also the files in the directory are now being named with time on them. So my problem is for eg: I have a file with "A.20080410.0700.txt"(file name appended with date 10th april) and "A.20080408.0700.txt" (file name appended with date 8th april) if "A.20080408.0700.txt" was inserted into the directory after A.20080410.0700.txt, the program takes "A.20080408.0700.txt" first for processing irrespective of the date and time appended to the filename.(where as I expect the program to process "A.20080410.0700.txt" first) I need the program in such a way that it pulls the file in accordance with the date and time appended to the file name rather than processing the file in the order in which they were generated in the directory. How can I get this done? Thanks in advance. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|