From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96076339121511.tru64-unix-managers.marc@archive.invalid> From: carole () callutheran ! edu (Carole Thompson) Date: Tue, 17 Sep 1996 17:17:56 +0000 To: tru64-unix-managers Subject: Q: how to extract a changing dir name X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96076339121511 I would like to create a script which culls statistics about logins, su attempts, connects, etc. from the log files contained in the syslog.dated/ I recycle my system daily after backup to cleanup defunct processes, so a new is created every day. How can I extract the exact name and plug it into a script so that I can cd to it, and run greps and wc commands, etc on the log files? For example, I would have to ls the /var/adm/syslog.dated directory, and extract as a string the directory name 17-Sep-03:12 then cd /var/adm/syslog.dated/17-Sep-03:12 Does anyone have code or a monitoring scripts you'd be willing to share? Thanks. Carole Thompson California Lutheran University carole@callutheran.edu # pwd /usr/var/adm/syslog.dated # ls -ls total 8 1 drwxr-xr-x 2 root adm 512 Sep 12 04:28 12-Sep-04:28 1 drwxr-xr-x 2 root adm 512 Sep 13 04:28 13-Sep-04:28 1 drwxr-xr-x 2 root adm 512 Sep 14 04:29 14-Sep-04:29 1 drwxr-xr-x 2 root adm 512 Sep 15 03:11 15-Sep-03:11 1 drwxr-xr-x 2 root adm 512 Sep 16 03:11 16-Sep-03:11 1 drwxr-xr-x 2 root adm 512 Sep 17 03:12 17-Sep-03:12 # cd 17-Sep-03:12 # ls auth.log kern.log mail.log user.log daemon.log lpr.log syslog.log