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


Groups > linux.debian.user > #192511

Re: Re (2): Configuration of router.

From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups linux.debian.user
Subject Re: Re (2): Configuration of router.
Date 2018-02-16 17:30 +0100
Message-ID <vjR3z-2WR-1@gated-at.bofh.it> (permalink)
References <vjQKe-2OK-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Feb 16, 2018 at 07:28:45AM -0800, peter@easthope.ca wrote:
> peter@hertz:~$ declare -f wake
> wake () 
> { 
>     input="";
>     until [[ $input != "" ]]; do
>         echo Beginning loop.;
>         /usr/bin/play /usr/share/sounds/ekiga/ring.wav;
>         read -n 1 -t 4 input;
>     done
> }
> 
> Therefore my .bashrc creates wake.

This only demonstrates that *something* defined your function.  It
doesn't prove that it was ~/.bashrc.  The obvious way to prove
whether it's ~/.bashrc doing it would be to read ~/.bashrc and see
what it says.

> Nevertheless,
> peter@hertz:~$ xterm -display :0 -e bash -c '. ~/.bashrc; declare -f wake; sleep 5'
> shows a black xterm, which, after 5 s, closes.  Appears that this 
> declaration fails.

Use "type wake" instead of "declare -f wake", so that you at least get
an *error* if it's not defined.

wooledg:~$ declare -f wake
wooledg:~$ type wake
bash: type: wake: not found

> That has become a secondary problem.  My current priority is to find 
> why at fails to open the xterm at the specified future time. None of 
> the at documents I've found mention error reporting.  Can a failure of 
> at be investigated without changing and recompiling the source?

       An at - or batch - command invoked from a su(1) shell will  retain  the
       current  userid.   The  user will be mailed standard error and standard
       output from his commands, if any.  Mail will be sent using the  command
       /usr/sbin/sendmail.  If at is executed from a su(1) shell, the owner of
       the login shell will receive the mail.

This is rather poorly written, but if you ignore the leading and
trailing sentences about su, or if you simply *try* things and see
what happens, you should see that you will indeed be sent the stdout
and stderr from your at(1) jobs in email, just like with crontab jobs.

Testing now:

wooledg:~$ echo echo hello | at now + 1 minute
warning: commands will be executed using /bin/sh
job 2 at Fri Feb 16 11:19:00 2018

And yes, I got the expected email.

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


Thread

Re (2): Configuration of router. peter@easthope.ca - 2018-02-16 17:10 +0100
  Re: Re (2): Configuration of router. Greg Wooledge <wooledg@eeg.ccf.org> - 2018-02-16 17:30 +0100
  Re: Re (2): Configuration of router. David Wright <deblis@lionunicorn.co.uk> - 2018-02-16 18:20 +0100

csiph-web