Google Answers Logo
View Question
 
Q: Bourne Expression (Shell Programming) ( No Answer,   2 Comments )
Question  
Subject: Bourne Expression (Shell Programming)
Category: Computers > Programming
Asked by: coderoyal-ga
List Price: $7.00
Posted: 08 Jul 2004 13:09 PDT
Expires: 08 Jul 2004 16:45 PDT
Question ID: 371463
When I put these commands in:

HOME=2
HOME='expr $HOME "+" 1'
echo $HOME

The result is just the echo: expr $HOME "+" 1

I want it to define $HOME as 3. All the example scripts show that my
command should have worked!

Getting frustrated because the a script I'm trying to make won't work.

http://unix.about.com/library/course/blshscript-l7a.htm 
http://www.ss64.com/bash/expr.html
Answer  
There is no answer at this time.

Comments  
Subject: Re: Bourne Expression (Shell Programming)
From: bschonec-ga on 08 Jul 2004 13:12 PDT
 
You need 'back ticks'

The are just to the left of the number one on the keyboard.


HOME=2
HOME=`expr $HOME "+" 1`
echo $HOME
Subject: Re: Bourne Expression (Shell Programming)
From: coderoyal-ga on 08 Jul 2004 16:45 PDT
 
Well, that answers my question! THANK YOU!!!

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy