Simpler Navigation coming for Servers and Operating Systems
Coming soon: a much simpler Servers and Operating Systems section of the Community. We will combine many of the older boards, and you won't have to click through so many levels to get at the information you need. If you are looking for an older board and do not find it, check the consolidated boards, as the posts are still there.
Showing results for 
Search instead for 
Did you mean: 

Adding a string

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)?
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

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...