cancel
Showing results for 
Search instead for 
Did you mean: 

Shell scripting

saraswathy_2
Occasional Contributor

Shell scripting


Wanted logic to substitute regularly 'date and PID' in log file.

Log File : ObjectSpawner_2010-03-23_10363.log

sas 10363 10357 0 Mar 21 ? 0:01 /opt/sas9.2/software/SASFoundation/9.2/utilities/bin/objspawn -dnsMatch sasseam.uk.capitalone.com -sasSpawnerCn Object Spawner
jes397 28800 25094 0 15:32:38 pts/4 0:00 grep sasSpawnerCn
2 REPLIES
James R. Ferguson
Acclaimed Contributor

Re: Shell scripting

Hi:

# echo "ObjectSpawner_$(date +%Y-%m-%d)_$$.log"

Regards!

...JRF...
Michael Steele_2
Honored Contributor

Re: Shell scripting

Hi

For the pid you would

print $$

-or-

PID-$(print $$)
echo $PID

ObjectSpawner_2010-03-23_10363_$PID.log
Support Fatherhood - Stop Family Law