|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Red Hat Red Hat is the world's leading open source technology solutions provider with offerings including Red Hat Enterprise Linux (RHEL), Fedora, open source applications, security and systems management, virtualization, and Services Oriented Architecture (SOA) solutions. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
i am new to shell programming, currently using redhat linux of version
2.4.20-8. i have problem in executing expr command in the following shell script $ x=5 $ x='expr $x + 1' $ echo $x the output is displaying always expr $x + 1 Pls guide me for the above query |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
how to use expr
You need to use back tics not single quotes
x=`expr $x + 1` |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
I tried to use expr for multiplication, but got an error. I used '*' symbol. Can you tell me what's the problem, or if there is another way? Thanks
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Error with expr - "expr: syntax error" | jagari | Shell Programming and Scripting | 6 | 02-24-2012 05:25 AM |
| expr ?! | Mad van Bert | UNIX for Dummies Questions & Answers | 1 | 09-06-2011 03:28 AM |
| the expr \* | jackel7777 | Shell Programming and Scripting | 1 | 07-29-2011 10:29 PM |
| test expr VS [ expr ] | ashok.g | Shell Programming and Scripting | 2 | 12-03-2009 06:42 AM |
| expr | Nathe | UNIX for Dummies Questions & Answers | 5 | 01-22-2004 06:49 PM |
|
|