Operating System - HP-UX
1753487 Members
4187 Online
108794 Solutions
New Discussion юеВ

Re: Script for Network Ping Status.

 
SOLVED
Go to solution
James R. Ferguson
Acclaimed Contributor

Re: Script for Network Ping Status.

Hi:

> Mel: I think you mean:

# ran=$RANDOM

...since it's the 'ran' variable you later reference :-)

That said, you can make a unique temporary file with the basename and pid of the process. A trap can be used to automatically remove it too:

MYNAME=${0##*/}
MYLOG=/var/tmp}/${MYNAME}.${$}
trap 'rm -f ${MYLOG}' EXIT

Regards!

...JRF...
Mel Burslan
Honored Contributor

Re: Script for Network Ping Status.

Sorry... JRFs right... I should not try attempting to put together scripts before I consume my daily allowance of caffeeine.

Also another missing curly bracket I noticed here:

rm /var/tmp/tempfile.$ran}

should be

rm /var/tmp/tempfile.${ran}

copy and pastis easyf yowrote the first instance right. Otherwise it cascades the errors.
________________________________
UNIX because I majored in cryptology...
Narendra Uttekar
Regular Advisor

Re: Script for Network Ping Status.

Hi All,
Thanks a lot for the solution.