I have variable $OUTPUT=abc PHYSIN=lalala ghi
How can I extract the value of PHYSIN into another new variable called VETH_NAME,
in other words, I'd like VETH_NAME to be lalala
How can I do so using bash commands?
Thanks
I have variable $OUTPUT=abc PHYSIN=lalala ghi
How can I extract the value of PHYSIN into another new variable called VETH_NAME,
in other words, I'd like VETH_NAME to be lalala
How can I do so using bash commands?
Thanks
Use parameter expansion with the %% operator, which drops the longest matching suffix from the expansion.
OUTPUT=abc
PHYSIN="lalala ghi"
VETH_NAME=${PHYSIN%% *}
bash tag wiki where we have collected a number of common FAQs. Obviously, if you'd like to help us maintain, organize, and develop this resource, you're most welcome! Thanks in advance.