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...

3
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by binnie
0

Hey There,

For loop example:

for x in a b c
do
    echo $x
done

conditional 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

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...

see my sig links for learning bash scripting. If you want to do floating point maths, you can use tools like bc.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.