![]() |
Hello and Welcome from to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to use expr | saikumarm80 | Red Hat | 3 | 01-05-2009 03:52 PM |
| problem with expr command | ravi raj kumar | UNIX for Dummies Questions & Answers | 8 | 09-03-2007 05:59 AM |
| expr problem | kotasateesh | Shell Programming and Scripting | 2 | 08-31-2007 09:00 AM |
| expr | Nathe | UNIX for Dummies Questions & Answers | 5 | 01-22-2004 07:49 PM |
| how do I get the value of expr with ksh | krishna | UNIX for Advanced & Expert Users | 3 | 08-26-2001 02:51 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
What you are doing here is assigning the 'standard output' of running '"scale=2;22/10" | bc' to the variable 'test'. Unfortunately that is not a valid command and the only output is to standard error. What you need is:
Code:
test=`echo "scale=2;22/10" | bc` echo $test |
|
||||
|
Quote:
awk 'BEGIN{ print (22/10) }' Thanks Namish Tiwari |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|