1752786 Members
5820 Online
108789 Solutions
New Discussion юеВ

Re: Adding a string

 
Tonatiuh
Super Advisor

Adding a string

Red Hat Enterprise Linux 3.0

I issue this line to append the text to the .bash_profile file.

echo "export ORACLE_DOC=$ORACLE_HOME/doc" >> .bash_profile

But if change the "$ORACLE_HOME" and put the value of this variable, which is nothing in the moment the command executes.

How can I add the text "$ORACLE_HOME" as simple string (not its value)?
3 REPLIES 3
Bharat Katkar
Honored Contributor

Re: Adding a string

No that sure but see if this works...

echo export ORACLE_DOC="$ORACLE_HOME"/doc >> .bash_profile

Regards,
You need to know a lot to actually know how little you know
Ivan Ferreira
Honored Contributor

Re: Adding a string

Use simple quotation:

echo 'export ORACLE_DOC=$ORACLE_HOME/doc' >> .bash_profile
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Mel Burslan
Honored Contributor

Re: Adding a string

try this

echo "export ORACLE_DOC=\$ORACLE_HOME/doc" >> .bash_profile

the backslash makes the $ sign a character instead of the shell variable descriptor.

Hope this helps
________________________________
UNIX because I majored in cryptology...