Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    What is fi or "the fi command" in Linux/Unix?

    Reply
    Page 2 of 2 | Prev |   1   2 |
    briand | # 11 | 2008-04-30, 18:36 | Report

    Originally Posted by
    but then you'd have to go fi-fi-fi-fi at the end...
    or you could simply chant:

    fi-fi-fo-fum,
    I suspect a shell script-run.


    sorry, couldn't resist

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to briand For This Useful Post:
    Benson

     
    GeraldKo | # 12 | 2008-04-30, 19:27 | Report

    Originally Posted by penguinbait View Post
    As mentioned "fi" is the end of a "if" statement

    if something happens
    then
    do something
    else
    dont do something
    fi
    If you look at question and answer #1 in this post, ... well, it seems to me that it went

    (A) If ... fi; else ... fi

    rather than

    (B) If ... else ... fi

    which is what I'd have expected. But when I went with (B) (that is, without the first fi), the script didn't work. With (A) I had success. Is there an "implicit if" in "RC=$?" or something like that?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    m_stolle | # 13 | 2008-04-30, 20:33 | Report

    The if's and fi's have to be balanced. Assuming there are no more "if"'s in (A) in the dotted parts, then (A) will definitely NOT work.

    In the original post, unless there is an additional "if" in the beginning, the first snippet is not valid. Which would explain why th unmounting didn't work. The second snippet looks correct (and is the one that is supposed to be working anways).

    What's the problem?

    Martin

    Edit | Forward | Quote | Quick Reply | Thanks

     
    mplawner | # 14 | 2008-05-02, 03:47 | Report

    Isn't it time to...

    daerht

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Page 2 of 2 | Prev |   1   2 |
vBulletin® Version 3.8.8
Normal Logout