Hi!
I have some shell scripts receiving in input lots of parameters and I need to select the ones having a particular value in one parameter.
A typical shell command line is:
PROMPT > shell_name.ksh -avalue_a -bvalue_b -cvalue_c -dvalue_d ...
I used a combinaton of ps and grep commands to select the right process, for instance:
PROMPT > ps -fu $LOGNAME | grep "shell_name\.ksh.*-dvalue_d" | grep -v grep
PROBLEM: if command line is too long, ps command extracts a part of it only (for instance till -cvalue_c), so grep command fails.
Consider that shell_name.ksh supports input parameters commutation, but I can't force shell users to launch script with -d parameter in first position.
Many thanks. Bye
Paride