happymind
happymind

Reputation: 3

Error while using shell script to copy lines to a file using cygwin

I am trying to copy few lines to another file .bashrc using shell script and cygwin terminal.The lines are :

echo "export DEVENVHOME=${DEVENVHOME:-$workarea/devenv.x}" >> .bashrc

I am writing command :

 workarea="/home/WORKAREA" sh script1.sh

But the output on .bashrc is :

  export DEVENVHOME=workarea/devenv.x

But i want the copy line

   export DEVENVHOME=${DEVENVHOME:-$workarea/devenv.x}

in .bashrc where $workarea should be replaced by the workarea provided as argument on cygwin terminal.

Upvotes: 0

Views: 36

Answers (1)

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798814

Single quotes suppress substitution.

echo '...' >> ...

Upvotes: 1

Related Questions