The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > Linux
Google UNIX.COM


Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
expr question low90s UNIX for Dummies Questions & Answers 3 04-29-2008 06:52 AM
expr command madhu_aqua14 UNIX for Dummies Questions & Answers 5 03-05-2007 03:26 PM
expr Nathe UNIX for Dummies Questions & Answers 5 01-22-2004 04:49 PM
how do I get the value of expr with ksh krishna UNIX for Advanced & Expert Users 3 08-26-2001 10:51 AM
expr command wolf UNIX for Dummies Questions & Answers 2 07-30-2001 10:43 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 11-30-2007
Registered User
 

Join Date: Nov 2007
Posts: 2
Post how to use expr

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
Reply With Quote
Forum Sponsor
  #2  
Old 11-30-2007
Registered User
 

Join Date: Oct 2007
Posts: 8
how to use expr

You need to use back tics not single quotes

x=`expr $x + 1`
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 08:59 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0