RSS Forums RSS
Please support our Shell Scripting advertiser: Programming Forums
Views: 892 | Replies: 3 | Thread Tools  Display Modes
Reply
Join Date: Jan 2008
Posts: 2
Reputation: binnie is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
binnie binnie is offline Offline
Newbie Poster

Help Begginer with Linux here nid help

  #1  
Jan 13th, 2008
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...
Last edited by binnie : Jan 13th, 2008 at 6:05 am. Reason: For Contac email
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2007
Posts: 361
Reputation: eggi will become famous soon enough eggi will become famous soon enough 
Rep Power: 3
Solved Threads: 36
eggi eggi is offline Offline
Posting Whiz

Re: Begginer with Linux here nid help

  #2  
Jan 14th, 2008
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
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
Reply With Quote  
Join Date: Apr 2006
Posts: 140
Reputation: ghostdog74 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 26
ghostdog74 ghostdog74 is offline Offline
Junior Poster

Re: Begginer with Linux here nid help

  #3  
Jan 14th, 2008
Originally Posted by binnie View Post
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.
Reply With Quote  
Join Date: Jan 2008
Posts: 2
Reputation: binnie is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
binnie binnie is offline Offline
Newbie Poster

Re: Begginer with Linux here nid help

  #4  
Jan 15th, 2008
Thanks it helps a lot!!!!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Other Threads in the Shell Scripting Forum
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 11:22 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC