Skip to main content
2 of 2
deleted 62 characters in body
Rui F Ribeiro
  • 58k
  • 28
  • 156
  • 238

Exporting environment variable

I want to export an environment variable whose value contains a variable but I don't want that variable (which is within the value) to be evaluated during the export process. i.e.

export STY=for i in {0..3}; do echo $i; done

so my requirement is that when I echo STY, the output that I need should be

echo $STY
for i in {0..3}; do echo $i; done 

But $i is evaluated during export. I need to preserve it as it is.

Shahzad
  • 111
  • 3