How does shell convert the following command line output into two?

as follows, ps-ef | grep tproxy | grep-v "grep" command will get tproxy process information,

user00    1561     1  0 Apr03 ?        00:01:00 ./tproxy --id=1.1.0.6 --port=6001 --conf-file=../etc/proxy.xml --sys-file=../etc/tproxy_sys.xml --env-type=new_version --daemon start
user00    1566     1  0 Apr03 ?        00:01:00 ./tproxy --id=1.1.1.6 --port=6002 --conf-file=../etc/proxy.xml --sys-file=../etc/tproxy_sys.xml --env-type=new_version --daemon start

are the two outputs shown above, which now need to be further split into two pieces of data.

ps-ef | grep tproxy | grep-v "grep" | awk-F "n""{print $1}"


awk

Mar.03,2021

So, what do you want to do? What is your demand?


I guess you're looking for xargs command?
because you don't understand what needs to be further divided into two pieces of data , so you don't want to write too much. Check to see if xargs is what you want.


I guess you want to use n as a separator, and then failed?
ps-ef | grep tproxy | grep-v "grep" | awk' BEGIN {FS= "n"} {print $1}'
try this method to set the delimiter


ps-ef | grep tproxy | grep-v "grep" | head-n 1

ps-ef | grep tproxy | grep-v "grep" | tail-n 1

Menu