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


Groups > linux.debian.user > #227296

Re: notify via virtual terminal available packages

Path csiph.com!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!news.dns-netz.com!news.freedyn.net!aioe.org!bofh.it!news.nic.it!robomod
From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups linux.debian.user
Subject Re: notify via virtual terminal available packages
Date Thu, 24 Sep 2020 16:40:02 +0200
Message-ID <ASAzE-4fD-9@gated-at.bofh.it> (permalink)
References <ASjS9-2t3-9@gated-at.bofh.it> <ASzNf-3Kv-7@gated-at.bofh.it> <ASzWW-3NY-3@gated-at.bofh.it> <ASAzE-4fD-11@gated-at.bofh.it>
X-Mailbox-Line From debian-user-request@lists.debian.org Thu Sep 24 14:39:11 2020
Old-Return-Path <wooledg@eeg.ccf.org>
X-Amavis-Spam-Status No, score=-5.501 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, FOURLA=0.1, KHOP_HELO_FCRDNS=0.399, LDO_WHITELIST=-5, WORD_WITHOUT_VOWELS=1] autolearn=no autolearn_force=no
X-Policyd-Weight using cached result; rate:hard: -4.6
Mail-Followup-To debian-user@lists.debian.org
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.10.1 (2018-07-13)
X-Mailing-List <debian-user@lists.debian.org> archive/latest/767659
List-ID <debian-user.lists.debian.org>
List-URL <https://lists.debian.org/debian-user/>
List-Archive https://lists.debian.org/msgid-search/20200924143855.GL931@eeg.ccf.org
Approved robomod@news.nic.it
Lines 31
Organization linux.* mail to news gateway
Sender robomod@news.nic.it
X-Original-Date Thu, 24 Sep 2020 10:38:55 -0400
X-Original-Message-ID <20200924143855.GL931@eeg.ccf.org>
X-Original-References <fb6bb31b-19ad-007b-63ff-8a80c0317c23@fuckaround.org> <20200924072328.1a21dcb7@jhegaala.localdomain> <20200924135359.GK931@eeg.ccf.org> <20200924081004.6f8a71bb@jhegaala.localdomain>
Xref csiph.com linux.debian.user:227296

Show key headers only | View raw


On Thu, Sep 24, 2020 at 08:10:04AM -0600, Charles Curley wrote:
> On Thu, 24 Sep 2020 09:53:59 -0400
> Greg Wooledge <wooledg@eeg.ccf.org> wrote:
> 
> > RANDOM is a bashism, not available in sh, so that won't work in a
> > crontab unless you've altered which shell cron is using to parse the
> > crontab.
> 
> Well, that's interesting. The file I pulled that from (in /etc/cron.d)
> sets two variables explicitly:
> 
> SHELL=/bin/sh
> PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
> 
> And the machine that it runs on shows:
> 
> root@hawk:~# ll /bin/sh
> lrwxrwxrwx 1 root root 4 Jan 17  2019 /bin/sh -> dash*

In dash, RANDOM does nothing; it's just an empty variable.  And as it
turns out, dash treats that as a zero.

unicorn:~$ dash
$ echo $((1 + RANDOM % 1200))
1
$ echo $((1 + % 1200))
dash: 2: arithmetic expression: expecting primary: "1 + % 1200"
$ echo $((1 + XYZZY % 1200))
1

So you're just doing "sleep 1" every time.

Back to linux.debian.user | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

notify via virtual terminal available packages Pòl Hallen <deben@fuckaround.org> - 2020-09-23 22:50 +0200
  Re: notify via virtual terminal available packages john doe <johndoe65534@mail.com> - 2020-09-24 10:40 +0200
  Re: notify via virtual terminal available packages Charles Curley <charlescurley@charlescurley.com> - 2020-09-24 15:50 +0200
    Re: notify via virtual terminal available packages Greg Wooledge <wooledg@eeg.ccf.org> - 2020-09-24 16:00 +0200
      Re: notify via virtual terminal available packages Greg Wooledge <wooledg@eeg.ccf.org> - 2020-09-24 16:40 +0200
        Re: notify via virtual terminal available packages Charles Curley <charlescurley@charlescurley.com> - 2020-09-24 16:50 +0200
          Re: notify via virtual terminal available packages Greg Wooledge <wooledg@eeg.ccf.org> - 2020-09-24 17:00 +0200
          Deterministic delays in POSIX shell scripts (Was: Re: notify via  virtual terminal available packages) Andy Smith <andy@strugglers.net> - 2020-09-25 09:50 +0200
            Re: Deterministic delays in POSIX shell scripts (Was: Re: notify via  virtual terminal available packages) Greg Wooledge <wooledg@eeg.ccf.org> - 2020-09-25 13:50 +0200
              Re: Deterministic delays in POSIX shell scripts (Was: Re: notify via  virtual terminal available packages) Andy Smith <andy@strugglers.net> - 2020-09-25 14:30 +0200
                Re: Deterministic delays in POSIX shell scripts (Was: Re: notify via  virtual terminal available packages) David Wright <deblis@lionunicorn.co.uk> - 2020-09-26 04:50 +0200
      Re: notify via virtual terminal available packages Charles Curley <charlescurley@charlescurley.com> - 2020-09-24 16:40 +0200

csiph-web