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



On Sat, 31 May 2008 17:17:36 +0000, 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

Are you sure the lines are empty, and do not contain a CR character?
This typically happens if you edit it on a non-unix machine, but these
days some editors and source code control system "helpfully" add them.
.



Relevant Pages

  • Re: perl warnings
    ... The first time it runs, parameter 'action' isn't defined so that is ... print "\$action is empty"; ... Use of uninitialized value in string eq at -e line 7. ... )' but that still produces a warning. ...
    (perl.beginners)
  • Use of uninitialized value in print
    ... print "Now will format .xls file\n"; ... #Holding Variables for mailing list ... After this I get warning talking about use of uninitialized value and ... but print statement is empty ...
    (comp.lang.perl.misc)
  • Re: Want to solve: Warning: Creating a pane with no CDocument
    ... Don't start with "empty project"! ... create a new MFC SDI project with the "Windows Explorer" ... style (in this case you will get splitter views from Microsoft, ... Warning: ...
    (microsoft.public.vc.mfc)
  • Re: How to suppress warning messages for empty lines in shell scripts?
    ... The nohup executes the script successfully but outputs a warning for the empty line: ... : command not found ... How can I suppress this warning (of cause without removing the empty line)? ...
    (comp.os.linux.misc)
  • Print Spooler will not Start
    ... After taking one day off I came back to printing problems. ... My Printers list is now empty. ... Warning - SceCli, ...
    (microsoft.public.win2000.printing)