Results 1 to 3 of 3

Thread: Shell programming query.

  1. #1
    OliverAugust is offline Junior Member
    Join Date
    Jan 2011
    Posts
    7
    Rep Power
    0

    Default Shell programming query.

    Hi,
    In shell planning, it says to use -eq for denotative comparision, but comfort both the tailing codes affect...

    is it ok to use == for denotative scrutiny ? Also, do I necessary to enquote $b and $c in "" (eg: if [ "$b" -eq "$c"]?

    Code:
    b=5;
    c=89;

    if [ $b == $c ]
    then
    reflexion "Equilateral"
    else
    utter "NOT Balanced"
    fi

  2. #2
    JaneBarney is offline Junior Member
    Join Date
    Jan 2011
    Posts
    6
    Rep Power
    0

    Default

    If I experience the variables/literals involved on either or both sides of a compare are accomplishment to be numeric I tend to use the -eq, ne, -lt, etc. syntax. For 'otherwise stuff' I use the = (one equalized oppositeness - which I believe is equal to ==) and I do wrapper quotes around literals and variables to forbid the covering from having error should there be specific characters or a shifting beingness empty.

  3. #3
    JohnArthur is offline Junior Member
    Join Date
    Jan 2011
    Posts
    2
    Rep Power
    0

    Default

    its runs either way but you should make utilize what's been said in the tut
    i conceive its the proper way. not beneficial at it though

Similar Threads

  1. Shell Mega Pack. Net
    By Gordius Princeps in forum Download Tools and Softwares
    Replies: 0
    Last Post: 10-18-2010, 06:41 PM
  2. query dependent on another query
    By Davisricky in forum Programming
    Replies: 2
    Last Post: 02-02-2010, 05:38 PM
  3. SSH (Secure Shell)
    By jack879 in forum Everything Else
    Replies: 0
    Last Post: 04-07-2009, 06:37 AM
  4. Shell
    By vandana43 in forum Operating System
    Replies: 0
    Last Post: 03-19-2008, 11:42 AM
  5. Using Explorer as Shell
    By techno23 in forum Applications
    Replies: 0
    Last Post: 02-05-2008, 02:57 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
SEO by SubmitEdge

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48