Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #166821

Re: My script almost works but spams the terminal its launched from if useing dash.

Path csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod
From Gene Heskett <gheskett@shentel.net>
Newsgroups linux.debian.user
Subject Re: My script almost works but spams the terminal its launched from if useing dash.
Date Sun, 17 Apr 2016 13:50:02 +0200
Message-ID <roTnc-3AB-9@gated-at.bofh.it> (permalink)
References <roAky-5Ir-13@gated-at.bofh.it> <roC2Z-76O-15@gated-at.bofh.it> <roOnw-8i1-3@gated-at.bofh.it>
X-Mailbox-Line From debian-user-request@lists.debian.org Sun Apr 17 11:41:51 2016
Old-Return-Path <gheskett@shentel.net>
X-Amavis-Spam-Status No, score=-7.995 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, LDO_WHITELIST=-5, RP_MATCHES_RCVD=-0.996, WEIRD_PORT=0.001] autolearn=ham autolearn_force=no
X-Policyd-Weight NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_BL_NJABL=-1.5 CL_IP_EQ_FROM_MX=-3.1; rate: -6.1
X-Asg-Debug-ID 1460893282-0aa8524fb11de3a60001-KlT975
X-Barracuda-Envelope-From gheskett@shentel.net
X-Barracuda-Effective-Source-IP n64s149.fttx.shentel.net[204.111.64.149]
X-Barracuda-Apparent-Source-IP 204.111.64.149
X-Barracuda-Rbl-IP 204.111.64.149
X-Asg-Orig-Subj Re: My script almost works but spams the terminal its launched from if useing dash.
User-Agent KMail/1.9.10 (enterprise35 0.20100827.1168748)
X-Kmail-Quoteprefix >
MIME-Version 1.0
Content-Type Text/Plain; charset="windows-1252"
Content-Transfer-Encoding 7bit
Content-Disposition inline
X-Barracuda-Connect smtp1.edbg.cloud.shentel.net[204.111.2.17]
X-Barracuda-Start-Time 1460893282
X-Barracuda-URL https://barracuda1.shentel.net:443/cgi-mod/mark.cgi
X-Barracuda-Scan-Msg-Size 2948
X-Barracuda-Brts-Status 1
X-Barracuda-Brts-Evidence geneslinuxbox.net
X-Barracuda-Spam-Score 0.50
X-Barracuda-Spam-Status No, SCORE=0.50 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=6.0 tests=WEIRD_PORT
X-Barracuda-Spam-Report Code version 3.2, rules version 3.2.3.28809 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 WEIRD_PORT URI: Uses non-standard port number for HTTP
X-Mailing-List <debian-user@lists.debian.org> archive/latest/706314
List-ID <debian-user.lists.debian.org>
List-URL <https://lists.debian.org/debian-user/>
List-Archive https://lists.debian.org/msgid-search/201604170741.21469.gheskett@shentel.net
Approved robomod@news.nic.it
Lines 69
Organization linux.* mail to news gateway
Sender robomod@news.nic.it
X-Original-Date Sun, 17 Apr 2016 07:41:21 -0400
X-Original-Message-ID <201604170741.21469.gheskett@shentel.net>
X-Original-References <201604161123.49744.gheskett@shentel.net> <5712725A.6050601@gmail.com> <57132C3D.9070306@gmail.com>
Xref csiph.com linux.debian.user:166821

Show key headers only | View raw


On Sunday 17 April 2016 02:25:01 Michael Milliman wrote:

> On 04/16/2016 12:11 PM, Aero Maxx wrote:
> > On 16/04/2016 17:45, Gene Heskett wrote:
> >> On Saturday 16 April 2016 12:01:28 Aero Maxx wrote:
> >>> On 16/04/2016 16:23, Gene Heskett wrote:
> >>>> 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
> >>>
> >>> dash isn't the same as bash, as it has a limited set of
> >>> instructions or commands it can do.
> >>>
> >>> But I too would be interested to know if it is possible to get it
> >>> to work in dash, I don't believe it is, but I am happy to be
> >>> corrected or proved wrong.
> >>>
> >>>> 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.
> >>>
> >>> Also isn't the command you are running supposed to be as follows ?
> >>>
> >>>> bin/mailwatcher 2>&1 > /dev/null &
> >>
> >> Is the space you inserted into my line between the > and the
> >> /dev/null a game changer? In either bash or dash?  Its been a while
> >> since I last read the bash docs, but I don't recall there was any
> >> emphasis on that.
> >
> > I'm sorry I was a bit too eager to reply and neglected to change
> > what I had pasted in.
> >
> > I meant to say could you try this
> >
> >> bin/mailwatcher > /dev/null 2>&1 &
>
> Yes, this is the correct incantation.  The difference is very subtle.

And not very well noted in the bash .pdf or the man page.

> With ... 2>&1 >/dev/null, the error output is redirected to be the
> same as the standard output, and then the standard output is
> redirected to /dev/null -- leaving the error output still going to the
> original standard output (terminal).  With ... >/dev/null 2>&1 The
> standard output is redirected first, and the the error output is sent
> to the same place as the standard output, resulting in both going to
> /dev/null.  The order of redirection is important to the end results
> in this case.

Good to know, and thank you.

> > This email has been checked for viruses by Avast antivirus software.
> > https://www.avast.com/antivirus


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 — Previous in thread | Next in thread | Find similar | Unroll thread


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