Re: How to suppress warning messages for empty lines in shell scripts?
- From: Barry Margolin <barmar@xxxxxxxxxxxx>
- Date: Sat, 31 May 2008 16:44:30 -0400
In article <48418830$0$6551$9b4e6d93@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
buzzuz@xxxxxxxxxxx (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?
No, empty lines are fine in shell scripts.
I suspect what you actually have a are CR LF pairs as newlines, instead
of just LF, because you wrote the file on a Windows machine and
transferred it to Unix. Use dos2unix to fix it.
--
Barry Margolin, barmar@xxxxxxxxxxxx
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
.
- Prev by Date: Re: What means "*/5" in crontab file?
- Next by Date: Re: What means "*/5" in crontab file?
- Previous by thread: Re: How to suppress warning messages for empty lines in shell scripts?
- Next by thread: Re: What means "*/5" in crontab file?
- Index(es):
Relevant Pages
|