variable=$(ps -ef | awk '/[p]ort 10/ {print $12}')
The [p]
is a neat trick to remove the search from showing from ps
@Jeremy
If you post the output of ps -ef | grep "port 10"
, and what you need from the line, it would be more easy to help you getting correct syntax