I may have an output like one of the following (I am acuatlly using "ps eww <pid>" in a script and would like to assign one of the varable to a varable in my script):
example 1: a=1 b=2 c=3 d=4 e=5 f=6 g=8
or
example 2: e=5 d=3 b=1 a=2 c=4
or
example 3: 5=a 4=b 3=c
I need an easy command that will set a variable with what 3 is equal to:
example 1 I would like VAR=3 (since c was equal to 3)
example 2 I would like VAR=4 (since c was equal to 4)
example 3 I would like VAR= (since there was no c)
Sorry I dont think I make my self clear. The following would be the output of a command. They are not yet variables.
example 1: a=1 b=2 c=3 d=4 e=5 f=6 g=8
or
example 2: e=5 d=3 b=1 a=2 c=4
or
example 3: 5=a 4=b 3=c