so what im trying to do here is, find the column that contains the string "memAvailReal", then, output the value of "memAvailReal", so the desired output should be:
1109812
i dont want to hardcode a specific column number to grab because these strings may be in different columns.
# in the middle
$ echo "memTotalReal=3925908 memAvailReal=1109812 memBuffer=242676 memCached=641628" | sed '/^.*memAvailReal=/ s///;s/ .*$//'
1109812
# at the start
$ echo "memAvailReal=1109822 memTotalReal=3925908 memBuffer=242676 memCached=641628" | sed '/^.*memAvailReal=/ s///;s/ .*$//'
1109822
# at the end
$ echo "memTotalReal=3925908 memBuffer=242676 memCached=641628 memAvailReal=1109842 " | sed '/^.*memAvailReal=/ s///;s/ .*$//'
1109842
As you can see it works wherever the required parameter is in the line. I am making the assumption that you would pipe the output of the process generating the line directly into the above sed command.