telemorgan
MIS
Hey guys
As part of a script, I am trying to output the last line of a log file from the previous nights backup. The problem that I have is when the job fails there is two or sometimes three log files in the directory. I want the script to always read the latest log file. This wasn't a problem with Tru64 UNIX becuase it always read the latest file first. But in Solaris it looks like it reads the earlier file first even though im using the korn shell in both OS's.
I do a:
tail -1 *oraexp*.log
On a directory like this:
-rw-r--r-- 1 oracle oinstall 310506 Feb 2 23:47 testcp_oraexp_2004020222.log
-rw-r--r-- 1 oracle oinstall 310524 Feb 3 09:00 testcp_oraexp_2004020323.log
I'm looking to get this, Which I use as a testing string for other parts of the script.:
Export terminated successfully without warnings.
does anyone know how I could have the tail -1 command always look at the latest log file?
Thanks in advance.
As part of a script, I am trying to output the last line of a log file from the previous nights backup. The problem that I have is when the job fails there is two or sometimes three log files in the directory. I want the script to always read the latest log file. This wasn't a problem with Tru64 UNIX becuase it always read the latest file first. But in Solaris it looks like it reads the earlier file first even though im using the korn shell in both OS's.
I do a:
tail -1 *oraexp*.log
On a directory like this:
-rw-r--r-- 1 oracle oinstall 310506 Feb 2 23:47 testcp_oraexp_2004020222.log
-rw-r--r-- 1 oracle oinstall 310524 Feb 3 09:00 testcp_oraexp_2004020323.log
I'm looking to get this, Which I use as a testing string for other parts of the script.:
Export terminated successfully without warnings.
does anyone know how I could have the tail -1 command always look at the latest log file?
Thanks in advance.