How to suppress warning messages for empty lines in shell scripts? - Unix

This is a discussion on How to suppress warning messages for empty lines in shell scripts? - Unix ; From the command line I called (with nohup) a shell script which contains empty lines (for better readability). The nohup executes the script successfully but outputs a warning for the empty line: /usr/local/joch/bin/dotest: line 3: : command not found How ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: How to suppress warning messages for empty lines in shell scripts?

  1. How to suppress warning messages for empty lines in shell scripts?

    From the command line I called (with nohup) a shell script which contains empty lines
    (for better readability).

    The nohup executes the script successfully but outputs a warning for the empty line:

    /usr/local/joch/bin/dotest: line 3:
    : command not found

    How can I suppress this warning (of cause without removing the empty line)?

    Do I really have to always avoid empty lines in shell scripts?

    Jochen

  2. Re: How to suppress warning messages for empty lines in shell scripts?

    On 31 May 2008 17:17:36 GMT, Jochen Berninger wrote:
    | From the command line I called (with nohup) a shell script which contains empty lines
    | (for better readability).
    |
    | The nohup executes the script successfully but outputs a warning for the empty line:
    |
    | /usr/local/joch/bin/dotest: line 3:
    |: command not found
    |
    | How can I suppress this warning (of cause without removing the empty line)?
    |
    | Do I really have to always avoid empty lines in shell scripts?
    |
    | Jochen


    nohup doesn't actually execute the script, it just sets some OS data up,
    and passes things on to the normal shell.

    Blank lines in a script should be fine.

    Exactly how are you doing the nohup command line, and what do the first
    few lines of the script look like?


    --
    Reverend Paul Colquhoun, ULC. http://andor.dropbear.id.au/~paulcol
    Asking for technical help in newsgroups? Read this first:
    http://catb.org/~esr/faqs/smart-questions.html#intro

+ Reply to Thread