Home > Net >  How to solve Environment Variables with $ Character?
How to solve Environment Variables with $ Character?

Time:09-20

I have a Environment Variables:

 "PWD=uNfob$bA5052433"

When I print PWD out it always:

'uNfob'

I have tried :

'PWD=uNfob$bA5052433'

or

PWD='uNfob$bA5052433'

all not work,any suggestion ?

CodePudding user response:

This works for me:

VAR='aaa$bbb'
echo $VAR

aaa$bbb

PWD is a special shell variable that represents the current directory. You might want to use someting else.

CodePudding user response:

I solved it by 2 steps:

1.use single quotes 'PWD=uNfob$bA5052433'
2.add '/' 'PWD=uNfob/$bA5052433'
  • Related