Please support our Shell Scripting advertiser: Programming Forums
![]() |
•
•
Join Date: Jan 2008
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
I would like to ask for the looping statements and conditional statements syntax and some samples for me to easily understand...
And also, How can I edit numbers to have its decimal points like float and double in other programming language.
I'm really noobie with Linux so can someone please help me?
Post here or Email me:
darkloathe@yahoo.com
Thanks...
And also, How can I edit numbers to have its decimal points like float and double in other programming language.
I'm really noobie with Linux so can someone please help me?
Post here or Email me:
darkloathe@yahoo.com
Thanks...
Last edited by binnie : Jan 13th, 2008 at 6:05 am. Reason: For Contac email
•
•
Join Date: Oct 2007
Posts: 361
Reputation:
Rep Power: 3
Solved Threads: 36
Hey There,
For loop example:
conditional example
You can use printf in bash to work with floating point numerals, otherwise you need to simulate by multiplying or dividing (perhaps both) by 100 (assuming 2 decimal places) at some point and putting the decimal in the correct place using sed or some other OS built-in tool
Best wishes,
Mike
For loop example:
for x in a b c
do
echo $x
doneconditional example
if [ $a -lt 0 ] then echo $a elif [ $a -gt 5 ] echo $a else echo $a fi
You can use printf in bash to work with floating point numerals, otherwise you need to simulate by multiplying or dividing (perhaps both) by 100 (assuming 2 decimal places) at some point and putting the decimal in the correct place using sed or some other OS built-in tool
Best wishes,
Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
Earn 100% commissions on ClickBank. No Opt-In Or Upsell. Check out the Ultimate ClickBank SuperTip
------------------------------------------------------------------------
Earn 100% commissions on ClickBank. No Opt-In Or Upsell. Check out the Ultimate ClickBank SuperTip
•
•
Join Date: Apr 2006
Posts: 140
Reputation:
Rep Power: 3
Solved Threads: 26
•
•
•
•
I would like to ask for the looping statements and conditional statements syntax and some samples for me to easily understand...
And also, How can I edit numbers to have its decimal points like float and double in other programming language.
I'm really noobie with Linux so can someone please help me?
Post here or Email me:
darkloathe@yahoo.com
Thanks...
see my sig links for learning bash scripting. If you want to do floating point maths, you can use tools like bc.
![]() |
Other Threads in the Shell Scripting Forum
- Previous Thread: Date Validation again
- Next Thread: Finding a Sub String
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)





Linear Mode