I'm looking for a __simple__ way to approach this. I would like to
create a "log" type file from an application. Instead of logging to a
specific file name each time, I would like to log to a "base name" which
then appends an ever increasing number on the end. This is like a GDG in
z/OS, where I just specify DSN=SOME.NAME(+1) and the system generates
the next GDG number in sequence. So far, the best that I've come up with
is something like:

#!/bin/sh
cd /logging/sub/directory
export BASENAME=base.name
NEXT=$(ls -l ${BASENAME}.* | awk -F '.' '{print $NF}' | sort -nr | head
-1)
if [ -z $NEXT ]; then NEXT=0;fi
NEXT=$((1+${NEXT}))
export GDG=${BASEENAME}.${NEXT}
program --logname=${GDG}


--
John McKown
Senior Systems Programmer
HealthMarkets
Keeping the Promise of Affordable Coverage
Administrative Services Group
Information Technology

The information contained in this e-mail message may be privileged
and/or confidential.  It is for intended addressee(s) only.  If you are
not the intended recipient, you are hereby notified that any disclosure,
reproduction, distribution or other use of this communication is
strictly prohibited and could, in certain circumstances, be a criminal
offense.  If you have received this e-mail in error, please notify the
sender by reply and delete this message without copying or disclosing
it. 

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to