I am creating a script to stop a service thats been running for too long, in this case however we want to call the vendors .sh which allows the appliction to shutdown gracefully (so a "kill-9" just isn't going to cut it).
To call the vendors .sh I need to pass it the "Name" of the server service (specified using the -name command line switch when starting the daemon). This value is visible when you do a "ps -ef", however it can fall in random places.
boadmin 155984 328134 0 07:48:48 - 2:40 /opt/apps/busobj/bobj/bobje/enterprise120//aix_rs6000/WIReportServer -loggingPath /opt/apps/busobj/bobj/bobje/logging/ -fg -restart -name SIA_oianp140.WebIntelligenceProcessingServer5 -pidfile /opt/apps/busobj/bobj/bobje/serverpids/SIA_oianp140_SIA_oianp140.WebIntelligenceProcessingServer6.pid -ns oianp007:6400 -ns oianp007:6400
Any suggestions how I can "Find" the value after the "-name" command line option? do I need to throw the ps-ef results into an array, and then loop through it looking for the "-name" so i can take the next item in the array? That seems too complex IMHO, so I thought I would ask before trying to reinvent the wheel.