How can I read parts of a command output (after a specific character) into a bash variable?
So, I have a command that returns output in the following form
># command
VAR1=ABC
VAR2=DEF
VAR3=123
And I want to read VAR1 and VAR3 from this command into a shell script. So logically I run the following two commands
># command | grep VAR1
VAR1=ABC
># command | grep VAR3
VAR3=123
How can I only capture the part that appears after the first equal sign? (So "$ {VAR1}" = "ABC" and "$ {VAR3}" = "123"). It should also be noted that in the valley of any variable there may be a different equal sign, so I need to keep everything after the first equal sign, including the following
+3
source to share
2 answers