This is my first time I am posting a question here and I am very
novice to UNIX.
I have a directory called jobs and one of my applications creates log
file daily in jobs directory with system job id is suffix.
I would like to insert the latest file from that directory into a
variable so that I can use that variable as part of another
application.
Any suggestions.
Your help would be much appreiciated.
Saqi
Saqi wrote:
> Dear UNIX Lers,
>
> This is my first time I am posting a question here and I am very
> novice to UNIX.
>
> I have a directory called jobs and one of my applications creates log
> file daily in jobs directory with system job id is suffix.
>
> I would like to insert the latest file from that directory into a
> variable so that I can use that variable as part of another
> application.
>
> Any suggestions.
If by latest you mean most recent:
var=`ls -t jobs | head -1`
echo "$var"
Ed.
--
System Events
=-=-=-=-=-=-=
Sep 16 03:31:11 don kernel: lp0 on fire