Help - Tring to write basic currency Converter as a bash script
i haven't had much luck so far ********
as you can guess i'm not very good, can someone please help me, or point me in the right direction. Thanks |
let only handles integer operations. try "bc" for more advanced stuff.
|
Quote:
|
use the bc command, not let.
|
Quote:
so i've replaced the let with bc to leave me with this: echo please enter the amount in `$` that you wish to convert read but this still doesnt work |
you need to read the documentation to use it correctly, you can't just replace one word for another...
|
A wise man on here once said "Understand what you're doing, don't memorize it." I suggest you do that same FOOL! I'm joking, you're not a fool. Like Acid said, take your time to read documentation. You'll save yourself a bunch of frustration. If all else fails, see if you can find the source for a similar program, disect it and see where you're going wrong.
Regards, Brandon |
Ahh i dont stand a chance i just cant do it.
|
Now you definitely won't be able to do it with that attitude. Have you tried googling it? Go to Google.com/linux. you might be able to find something there. Alternately, try a different Linux site. There are more Linux Guru's in the world than just this one site. You have to be able to utilize all of your resources. That's what makes a good Computer Programmer/Technician. You CANNOT do everything on your own, everyone knows that. it's a nice thing to strive for, though.
Regards, Brandon |
[QUOTE=Robert Diggs] Go to Google.com/linux. [/QUOTE
I've searched in the google linux thing, but still no luck. I've been trying this for days and i'm still no further than i was. I've read book after book. I just dont understand. Am i even on ther right lines? I really don't have a clue |
hey,
Not sure if you're on the right lines, I'm not very knowledgeable when it comes to programming. But, like with anything, the answer will come with research and patience. Look up other progamming or Linux forums. Use google or another search engine to find another forum. Regards, Brandon |
Stupid example of what 'bc' could look like ITW...
Code:
A=100; B=2; C="0.93"; D=`echo "scale=2;($A-$B)/$C"|bc -l 2>/dev/null` |
I'd note that the above example is lot more complex than what you'd actually need...
|
Quote:
|
Maybe some Bash scripting guides first, then:
http://www.tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html http://www.tldp.org/LDP/Bash-Beginne...tml/index.html http://www.tldp.org/LDP/abs/html/ |
All times are GMT -5. The time now is 08:50 AM. |