By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,570 Members | 999 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,570 IT Pros & Developers. It's quick & easy.

problem in expr 3+5

sanjay123456
100+
P: 125
Dear friends ,

i am using shell script and file name is test.sh

and in test.sh i am written echo expr 3+5;

excution of this programe result is 3+5 its not give 8

so plz tell me where its wrong ???????????

sanjay
Nov 5 '07 #1
Share this Question
Share on Google+
1 Reply

radoulov
P: 34
Expand|Select|Wrap|Line Numbers
  1. echo $(expr 3 + 5)
Or just:

Expand|Select|Wrap|Line Numbers
  1. echo $((3+5))
Or (for older, older shells):

Expand|Select|Wrap|Line Numbers
  1. echo `expr 3 + 5`
Nov 7 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.