TechTalkz.com Logo

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Operating Systems > Open Source & Linux

Notices

expr:syntax error

Open Source & Linux


Reply
 
Thread Tools Display Modes
Old 20-08-2008, 08:39 PM   #1
Newbie
 
Join Date: Apr 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0 sunil.narnaware is an unknown quantity at this point
expr:syntax error


Problem Statement:
$x=10
$y=20
$expr $x * $y
$expr: syntax error

" Frnds i dont want to use $expr $x \* $y(the correct option) instead of $expr $x * $y to get the output 200."

how can i execute the above program and still get the output '200'?
sunil.narnaware is offline   Reply With Quote
Old 20-08-2008, 08:50 PM   #2
ƒ(ψ)=ΘΊΧφ
 
bakuryu's Avatar
 
Join Date: May 2006
Location: India
Age: 23
Posts: 6,621
Thanks: 19
Thanked 645 Times in 603 Posts
Rep Power: 87 bakuryu has a brilliant futurebakuryu has a brilliant futurebakuryu has a brilliant futurebakuryu has a brilliant futurebakuryu has a brilliant futurebakuryu has a brilliant futurebakuryu has a brilliant futurebakuryu has a brilliant futurebakuryu has a brilliant futurebakuryu has a brilliant futurebakuryu has a brilliant future


OS: Windows XP Windows Vista Windows 7


Send a message via Yahoo to bakuryu
Re: expr:syntax error

any reasons why not using \* ? saving keystrokes

echo "$x * $y" | bc
__________________
Please don't click here
bakuryu is offline   Reply With Quote
Old 22-08-2008, 06:40 PM   #3
Newbie
 
Join Date: Apr 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0 sunil.narnaware is an unknown quantity at this point
Re: expr:syntax error



ya the answer u gave is correct but i want the way i hv written and executed. so any solution??? any modification required in any file......?
sunil.narnaware is offline   Reply With Quote
Old 22-08-2008, 07:56 PM   #4
ƒ(ψ)=ΘΊΧφ
 
bakuryu's Avatar
 
Join Date: May 2006
Location: India
Age: 23
Posts: 6,621
Thanks: 19
Thanked 645 Times in 603 Posts
Rep Power: 87 bakuryu has a brilliant futurebakuryu has a brilliant futurebakuryu has a brilliant futurebakuryu has a brilliant futurebakuryu has a brilliant futurebakuryu has a brilliant futurebakuryu has a brilliant futurebakuryu has a brilliant futurebakuryu has a brilliant futurebakuryu has a brilliant futurebakuryu has a brilliant future


OS: Windows XP Windows Vista Windows 7


Send a message via Yahoo to bakuryu
Re: expr:syntax error

you can use the korn shell for that since it can distinguish between * as wildcard and * for multiplication.
bakuryu is offline   Reply With Quote
Old 17-04-2009, 08:41 AM   #5
Newbie
 
Join Date: Apr 2009
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0 xiangxianni is an unknown quantity at this point


OS: Windows 7


Re: expr:syntax error

You can use '' instead of "\"

expr $x '*' $y s

This works in C Shell
__________________
Windows 7 Guide | PC Tips
xiangxianni is offline   Reply With Quote
Reply

Thread Tools
Display Modes



< Windows Help - MS Office Help - Hardware Support >


New To Site? Need Help?

All times are GMT +5.5. The time now is 07:35 PM.


vBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2009, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional