LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 01-08-2009, 08:52 AM   #1
jonhanna
Member
 
Registered: Dec 2008
Posts: 31

Rep: Reputation: 15
question on shell scripting and multi-directional conditional branching


I am trying to find out the difference between definite and indefinite loops in shell scripting. I know about loops from my programming class but I cannot find anything on definite and indefinite loops. If someone could point me in the right direction that would be great?

My second question is what is multi-directional conditional branch? and what is the command you type to use this? I honestly have no idea what this is and if one of you guys could shine some light that would be great. thanks
 
Old 01-08-2009, 09:01 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
jonhanna;

I am glad to see you asking homework questions in a rational manner. One thing you need to do is be sure and follow-up in threads you start---eg here:
http://www.linuxquestions.org/questi...5/#post3398774

In that thread, you left us hanging---wondering if you ever solved the problem.

You current questions will be pretty easy to find on Google. I'll give you a hint on #2: There are two basic constructs:
case (aka "switch" in C)
if / elif ("else if" in some languages)

In your previous thread I recommended the Bash Guide for Beginners. That will cover these two approaches.

Last edited by pixellany; 01-08-2009 at 09:04 AM.
 
Old 01-08-2009, 09:18 AM   #3
jonhanna
Member
 
Registered: Dec 2008
Posts: 31

Original Poster
Rep: Reputation: 15
I guess I am not understanding what you mean by your answer, sorry lol is there any way to go into further detail?

Last edited by jonhanna; 01-08-2009 at 09:26 AM. Reason: typed wrong
 
Old 01-08-2009, 09:26 AM   #4
jonhanna
Member
 
Registered: Dec 2008
Posts: 31

Original Poster
Rep: Reputation: 15
I have just figured out the first question, I was just typing the wrong things, I am still clueless on the second though.
 
Old 01-08-2009, 10:09 AM   #5
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285
Quote:
Originally Posted by jonhanna View Post
My second question is what is multi-directional conditional branch? and what is the command you type to use this? I honestly have no idea what this is and if one of you guys could shine some light that would be great. thanks
Typically you would use a "switch" in C or a "case" in bash. See here:
http://tldp.org/LDP/abs/html/testbranch.html#EX29

It's like an extended 'if' 'elif' 'else' statement, in a more user-friendly readable format, testing to see if the variable matches the condition in each case, if it does then the command there is run.
 
Old 01-08-2009, 10:33 AM   #6
jonhanna
Member
 
Registered: Dec 2008
Posts: 31

Original Poster
Rep: Reputation: 15
thank you very much guys, I really appreciate all of the links as well, since I joined this site my favorites have grown 10 fold lol
 
Old 01-08-2009, 03:00 PM   #7
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by jonhanna View Post
I guess I am not understanding what you mean by your answer, sorry lol is there any way to go into further detail?
If you are referring to "case" and "if - elif", then the documents you've been referred to have all the details.

Try to post specific questions--eg exactly what you don't understand.
 
Old 01-09-2009, 08:24 AM   #8
jonhanna
Member
 
Registered: Dec 2008
Posts: 31

Original Poster
Rep: Reputation: 15
Alright I appreciate it, I getting there step by step. lol
 
Old 01-09-2009, 08:41 AM   #9
chakka.lokesh
Member
 
Registered: Mar 2008
Distribution: Ubuntu
Posts: 240

Rep: Reputation: 32
Quote:
Originally Posted by jonhanna View Post
lol
Is it necessary to laugh that many times?
 
Old 01-09-2009, 08:52 AM   #10
jonhanna
Member
 
Registered: Dec 2008
Posts: 31

Original Poster
Rep: Reputation: 15
is it necessary for you to even comment on this thread, no
 
Old 01-09-2009, 09:33 AM   #11
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285
lol, lol
 
Old 01-09-2009, 11:58 AM   #12
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
OoooooooooKay....so the question has been answered and the conversation has degenerated into (whatever)

Closed

Last edited by pixellany; 01-09-2009 at 03:40 PM.
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell Scripting Question Komelore Programming 2 02-28-2007 08:16 PM
shell scripting question bhert Linux - General 2 01-29-2007 09:55 PM
a shell-scripting question: mrchaos Slackware 3 09-22-2005 12:00 PM
Shell scripting question. dragin33 Linux - General 2 08-11-2004 06:17 PM
Shell Scripting Question chrisk5527 Linux - General 12 07-09-2003 04:36 PM


All times are GMT -5. The time now is 08:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration