Senthilraja Natarajan
Senthilraja Natarajan

Reputation: 25

Export command in shell script

I very much new to shell script. I was analyzing a script where i found a line as below

ABC="$GENABC +1 +2 +3 +4 +5 +6 +7 -8" ; export ABC

I don't understand what does +1 +2 etc stands for. Kindly explain me.

Upvotes: 0

Views: 145

Answers (1)

Etan Reisner
Etan Reisner

Reputation: 80931

As rjdkolb indicates the + characters there are just that, literal + characters in the value of the ABC variable.

You could have seen that easily enough yourself by trying it.

As I've done, for example, at http://ideone.com/H6vMeg

$ GENABC="original value"
$ ABC="$GENABC +1 +2 +3 +4 +5 +6 +7 -8" ; export ABC
$ declare -p ABC
declare -x ABC="original value +1 +2 +3 +4 +5 +6 +7 -8"

Upvotes: 2

Related Questions