Tuesday, May 7, 2024
14
rated 0 times [  14] [ 0]  / answers: 1 / hits: 18395  / 2 Years ago, tue, april 5, 2022, 10:53:04

If I wrote



export COMP_WORDS="this words"


I need something like



get-exported COMP_WORDS


expecting something like



COMP_WORDS="this words"


I tried



set | grep COMP_WORDS


but it takes others lines


More From » command-line

 Answers
2

To get the value of VARIABLE you can use



echo $VARIABLE


The quotes don't survive though



$ COMP_WORDS="you said what?"
$ echo $COMP_WORDS
you said what?


Unless you quote them...



$ quote='"2b || !2b"'
$ echo $quote
"2b || !2b"


It makes no difference whether you set the variable yourself or not


[#11213] Wednesday, April 6, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
mouedi

Total Points: 420
Total Questions: 109
Total Answers: 116

Location: Philippines
Member since Wed, Aug 19, 2020
4 Years ago
;