Professional Web Applications Themes

hpux 11 here doent problem - Linux / Unix Administration

Hi All, The OS is "HP-UX tuna B.11.00 U 9000/800 522706547 unlimited-user license" When the following function is called, it always complain "ksh: syntax error at line 6 : `fi' unexpected" I put in print statements for debugging and found that this error is generated at "EMB_BUILD" delimiter-word of the here doent at the end of the function. Is this a bug in the shell? How do I get around of it? function emb_build { ALL=FALSE LASB=FALSE IAHV=FALSE ISH=FALSE RSH=FALSE PS3='Pick one of the above:' select i in all lasb iahv ish rsh finish do case $i in all) ALL=TRUE ...

  1. #1

    Default hpux 11 here doent problem

    Hi All,

    The OS is "HP-UX tuna B.11.00 U 9000/800 522706547 unlimited-user
    license"
    When the following function is called, it always complain
    "ksh: syntax error at line 6 : `fi' unexpected"

    I put in print statements for debugging and found that this error is
    generated at "EMB_BUILD" delimiter-word of the here doent at the end
    of the function.

    Is this a bug in the shell? How do I get around of it?

    function emb_build {
    ALL=FALSE
    LASB=FALSE
    IAHV=FALSE
    ISH=FALSE
    RSH=FALSE

    PS3='Pick one of the above:'
    select i in all lasb iahv ish rsh finish
    do case $i in
    all) ALL=TRUE
    break;;
    iahv) IAHV=TRUE;;
    lasb) LASB=TRUE;;
    ish) ISH=TRUE;;
    rsh) RSH=TRUE;;
    finish) print -u2 "finished embedded selection"
    break;;
    esac
    done

    if [ $ALL = TRUE ]
    then
    IAHV=TRUE
    LASB=TRUE
    ISH=TRUE
    RSH=TRUE
    fi

    $CL setview P10_V230_EMB_Build << EMB_BUILD

    if [ $DEL_FLAG = TRUE ]
    delay # sleep and wake up sometime after midnight
    DEL_FLAG=FALSE # Only 1 delay allowed
    fi

    if [ $IAHV = TRUE ] # iahv build
    then
    test -f $curDir/Embd_builds/iahv/ArchitectProjects/done.txt && rm -f
    $curDir/E
    mbd_builds/iahv/ArchitectProjects/done.txt
    cd $curDir/Embd_builds/iahv
    ../bigbang.sh -e IAHV.prj
    fi

    if [ $LASB = TRUE ] # lasb build
    then
    test -f $curDir/Embd_builds/lasb/ArchitectProjects/done.txt && rm -f
    $curDir/
    Embd_builds/lasb/ArchitectProjects/done.txt
    cd $curDir/Embd_builds/lasb
    ../bigbang.sh -e P6_LSH.prj
    fi

    if [ $ISH = TRUE ] # ish build
    then
    test -f $curDir/Embd_builds/ish/ArchitectProjects/done.txt && rm -f
    $curDir/Em
    bd_builds/ish/ArchitectProjects/done.txt
    cd $curDir/Embd_builds/ish
    ../bigbang.sh -e ISH.prj
    fi

    if [ $RSH = TRUE ] # rsh build
    then
    test -f $curDir/Embd_builds/rsh/ArchitectProjects/done.txt && rm -f
    $curDir/Em
    bd_builds/rsh/ArchitectProjects/done.txt
    cd $curDir/Embd_builds/rsh
    ../bigbang.sh -e RSH.prj
    fi

    EMB_BUILD
    }


    ================================================== ===============
    Snippet of the output:

    + [ TRUE = TRUE ]
    + emb_build
    1) all
    2) lasb
    3) iahv
    4) ish
    5) rsh
    6) finish
    Pick one of the above:4
    Pick one of the above:6
    finished embedded selection
    ksh: syntax error at line 6 : `fi' unexpected
    + [ FALSE = TRUE ]
    + [ FALSE != TRUE ]
    + scc_build

    KT Guest

  2. #2

    Default Re: hpux 11 here doent problem

    KT wrote: 
    <snipped> 
    <snipped>

    The correct format for the above is:

    if [ $ALL = TRUE ] ; then
    ....
    ....
    fi

    Note the semicolon above.

    --

    Fletcher Glenn

    Fletcher Guest

  3. #3

    Default Re: hpux 11 here doent problem



    Fletcher Glenn wrote: 
    >
    > <snipped>

    >
    > <snipped>
    >
    > The correct format for the above is:
    >
    > if [ $ALL = TRUE ] ; then
    > ...
    > ...
    > fi
    >
    > Note the semicolon above.[/ref]

    No, the original is fine. Whether you do this:

    if [ whatever ] ; then

    or this:

    if [ whatever ]
    then

    is purely a matter of taste/style.

    Ed.
    Ed Guest

  4. #4

    Default Re: hpux 11 here doent problem

    * "KT" <com>
    | if [ $IAHV = TRUE ] # iahv build

    Have you tried w/o the comment after the test?

    # iahv build
    if [ $IAHV = TRUE ]
    then
    ...

    HP once didn't like comments or flags in the #!/bin/sh line either...

    R'
    Ralf Guest

  5. #5

    Default Re: hpux 11 here doent problem

    KT wrote:
     

    There *is* a 'then' missing.
    --
    Tony
    S. Guest

  6. #6

    Default Re: hpux 11 here doent problem

    [f'up2 c.u.shell]

    Ralf Fassel wrote: 

    To the best of my knowledge, all bourne compatible shells properly
    p such a line (given correct syntax in the following lines).
     

    That's a completely different issue because the #! line is pd
    by the kernel and not by a shell. On most unix variants, including
    HP-UX 8-11, the whole line is passed on as one argument. Important
    exceptions are SunOS 5, OpenServer 5 and Ultrix, which split and
    pass on the first "argument" only, and FreeBSD which really splits
    up and fills argv[].
    Sven Guest

  7. #7

    Default Re: hpux 11 here doent problem

    Ralf Fassel wrote: 
    Ralf,


    I was more think of:

    if [ $IAHV ="TRUE" ]
    then
    .....


    Regards,


    Jan Gerrit
    Jan Guest

Similar Threads

  1. HPUX password change problem
    By Shijith in forum Linux / Unix Administration
    Replies: 2
    Last Post: November 1st, 09:01 AM
  2. Mysql-DBD Perl module Installation Problem in HPUX
    By smsabu2002@yahoo.com in forum PERL Modules
    Replies: 1
    Last Post: June 30th, 05:59 PM
  3. ER problem HPUX - Linux
    By Sjaak van Esdonk in forum Informix
    Replies: 2
    Last Post: November 17th, 06:49 AM
  4. DBD::Oracle installation problem at HPUX
    By porschberg in forum PERL Modules
    Replies: 0
    Last Post: November 5th, 02:31 PM
  5. [PHP-DEV] PHP thread stack problem on HPUX
    By NAIK,ROSHAN in forum PHP Development
    Replies: 4
    Last Post: July 19th, 01:52 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
  •  

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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139