I have the following output from FlexLM (lmstat -a) :
Users of server: (Total of 5 licenses issued; Total of 4 licenses in use)
"feature1" v9.0, vendor: klocwork
floating license
tyoung host01 /dev/tty (v9.0) (flex1.com/27000 57756), start Mon 3/21 9:06 (linger: 1209600)
jfall host02 /dev/tty (v9.0) (flex1.com/27000 17731), start Fri 3/18 12:54 (linger: 1209600)
jfall host03 /dev/pts/1 (v9.0) (flex1.com/27000 29438), start Thu 3/24 9:33 (linger: 1209600)
jfall host04 /dev/tty (v9.0) (flex1.com/27000 12791), start Thu 3/24 13:39 (linger: 1209600)
Users of client: (Total of 10 licenses issued; Total of 5 licenses in use)
"feature2" v9.0, vendor: klocwork
floating license
jfall host04 /dev/tty (v9.0) (flex1.com/27000 127), start Thu 3/24 13:39 (linger: 1209600)
And I'd like to get an output using like
jfall feature1 17731
jfall feature1 29438
jfall feature1 12791
jfall feature2 127
I have some preference doing that using bash and/or Python. Please note that this output could be changed at any time, some users can check out feature1 or feature2. That's why I having hard time trying to find a pattern to parse.
Any help is appreciated
Current status:
$USER="jfall"
$LOGFILE="mylog.log"
HANDLE=(`cat $LOGFILE | grep $USER | awk '{print $6}' | tr -d '),'`)
HANDLE_LENGHT=${#HANDLE[@]}
for ((i=0; i<${HANDLE_LENGHT};i++))
do
echo "$USER ${HANDLE[$i]}"
done
Output :
jfall 17731
jfall 29438
jfall 12791
jfall 127
But I have no idea how I can get the list of feature assigned for each row. My first idea was to return the pattern starting by "" above each result, but I'm not sure how to implement it