Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #166774
| From | Gene Heskett <gheskett@shentel.net> |
|---|---|
| Newsgroups | linux.debian.user |
| Subject | My script almost works but spams the terminal its launched from if useing dash. |
| Date | 2016-04-16 17:30 +0200 |
| Message-ID | <roAky-5Ir-13@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
Greetings;
This bash script has lived in ~/bin for years, but the mention of dash as
a replacement for bash made me want to test it with dash by changing the
bang line to #!/bin/sh, which is of course (this is wheezy) a softlink
to /bin/dash.
I am launching it with this command as I don't want it to make any noise
at all when its running, just do its job:
bin/mailwatcher 2>&1 >/dev/null &
But when I run it with dash, it doesn't seem to work right, and spams the
terminal with its error messages. One that appears to kill its function
is the bashism of using [[ ]] to surround string variables, reported
like this:
bin/mailwatcher: 64: bin/mailwatcher: [[: not found
bin/mailwatcher: 70: bin/mailwatcher: [[: not found
bin/mailwatcher: 77: bin/mailwatcher: [[: not found
Which is nice, as I am seeing the reason it fails. Line 64 to illuminate
that is:
if [[ ${InMail} = 'gene' ]]
The other 2 lines are similar except for 'gene'
The return from inotifywait is what sets the value of ${InMail}
Can these lines be re-constructed to be valid for either bash or dash?
If so how?
And finally, once its working with either shell, how do I shut it up
totally? Even the above command line launch fails as it outputs to that
shell, a newline for every incoming mail which gradually scrolls any
output that was on-screen, offscreen without leaving a prompt until I
tap the return key to restore it.
Thank you for any insight on this.
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>
Back to linux.debian.user | Previous | Next — Next in thread | Find similar | Unroll thread
My script almost works but spams the terminal its launched from if useing dash. Gene Heskett <gheskett@shentel.net> - 2016-04-16 17:30 +0200
Re: My script almost works but spams the terminal its launched from if useing dash. Aero Maxx <aero.maxx.d@gmail.com> - 2016-04-16 18:10 +0200
Re: My script almost works but spams the terminal its launched from if useing dash. Gene Heskett <gheskett@shentel.net> - 2016-04-16 18:50 +0200
Re: My script almost works but spams the terminal its launched from if useing dash. Aero Maxx <aero.maxx.d@gmail.com> - 2016-04-16 19:20 +0200
Re: My script almost works but spams the terminal its launched from if useing dash. Gene Heskett <gheskett@shentel.net> - 2016-04-17 00:50 +0200
Re: My script almost works but spams the terminal its launched from if useing dash. Michael Milliman <michael.e.milliman@gmail.com> - 2016-04-17 08:30 +0200
Re: My script almost works but spams the terminal its launched from if useing dash. Jeremy Nicoll <jn.ml.dbn.25@letterboxes.org> - 2016-04-17 13:00 +0200
Re: My script almost works but spams the terminal its launched from if useing dash. "Thomas Schmitt" <scdbackup@gmx.net> - 2016-04-17 13:50 +0200
Re: My script almost works but spams the terminal its launched from if useing dash. Jeremy Nicoll <jn.ml.dbn.25@letterboxes.org> - 2016-04-17 15:10 +0200
Re: My script almost works but spams the terminal its launched from if useing dash. "Thomas Schmitt" <scdbackup@gmx.net> - 2016-04-17 15:30 +0200
Re: My script almost works but spams the terminal its launched from if useing dash. Michael Milliman <michael.e.milliman@gmail.com> - 2016-04-17 15:40 +0200
Re: My script almost works but spams the terminal its launched from if useing dash. Jeremy Nicoll <jn.ml.dbn.25@letterboxes.org> - 2016-04-17 16:40 +0200
Re: My script almost works but spams the terminal its launched from if useing dash. Michael Milliman <michael.e.milliman@gmail.com> - 2016-04-17 15:30 +0200
Re: My script almost works but spams the terminal its launched from if useing dash. Gene Heskett <gheskett@shentel.net> - 2016-04-17 13:50 +0200
Re: My script almost works but spams the terminal its launched from if useing dash. Andrew McGlashan <andrew.mcglashan@affinityvision.com.au> - 2016-04-22 06:30 +0200
Re: My script almost works but spams the terminal its launched from if useing dash. Michael Milliman <michael.e.milliman@gmail.com> - 2016-04-22 07:00 +0200
Re: Re: My script almost works but spams the terminal its launched from if useing dash. Clive Standbridge <list-user@tgstandbridges.plus.com> - 2016-04-22 11:40 +0200
Re: My script almost works but spams the terminal its launched from if useing dash. Gene Heskett <gheskett@shentel.net> - 2016-04-22 10:30 +0200
Re: My script almost works but spams the terminal its launched from if useing dash. David Wright <deblis@lionunicorn.co.uk> - 2016-04-22 13:10 +0200
Re: My script almost works but spams the terminal its launched from if useing dash. Sven Joachim <svenjoac@gmx.de> - 2016-04-16 18:50 +0200
Re: My script almost works but spams the terminal its launched from if useing dash. Gene Heskett <gheskett@shentel.net> - 2016-04-16 19:10 +0200
Re: My script almost works but spams the terminal its launched from if useing dash. Linux-Fan <Ma_Sys.ma@web.de> - 2016-04-16 19:30 +0200
Re: My script almost works but spams the terminal its launched from if useing dash. "Thomas Schmitt" <scdbackup@gmx.net> - 2016-04-16 20:10 +0200
Re: My script almost works but spams the terminal its launched from if useing dash. Gene Heskett <gheskett@shentel.net> - 2016-04-17 01:10 +0200
Re: My script almost works but spams the terminal its launched from if useing dash. David Wright <deblis@lionunicorn.co.uk> - 2016-04-17 04:30 +0200
Re: My script almost works but spams the terminal its launched from if useing dash. Gene Heskett <gheskett@shentel.net> - 2016-04-17 06:50 +0200
Re: My script almost works but spams the terminal its launched from if useing dash. David Wright <deblis@lionunicorn.co.uk> - 2016-04-18 16:00 +0200
Re: My script almost works but spams the terminal its launched from if useing dash. Gene Heskett <gheskett@shentel.net> - 2016-04-18 20:50 +0200
Re: My script almost works but spams the terminal its launched from if useing dash. "Thomas Schmitt" <scdbackup@gmx.net> - 2016-04-17 14:10 +0200
Re: My script almost works but spams the terminal its launched from if useing dash. "Thomas Schmitt" <scdbackup@gmx.net> - 2016-04-17 14:10 +0200
Re: My script almost works but spams the terminal its launched from if useing dash. Gene Heskett <gheskett@shentel.net> - 2016-04-17 15:20 +0200
Re: My script almost works but spams the terminal its launched from if useing dash. "Thomas Schmitt" <scdbackup@gmx.net> - 2016-04-17 16:40 +0200
csiph-web