In bash, I want to start my program (gollum) and use a part of the stderr (the port number) as an argument for another program. I redirect stderr to stdout and use grep and sed to filter the output. I get the result in stdout:
gollum -p0 2>&1| sed -n -e "s/.*port=//p"
It returns '56343' and continue to run as gollum is a server.
However if I want to use this as an argument of another program (i.e. echo but I want to use it later to launch an internet navigator with the port number ) with xargs it does not work.
gollum -p0 2>&1| sed -n -e "s/.*port=//p" | xargs -n1 echo
Nothing happen. Do you know why, or do you have another idea to do the same thing.
Thank you for your help.