Re: bash 5.0.11 – Output not redirected

2020-02-27 Thread Andreas Kusalananda Kähäri
On Thu, Feb 27, 2020 at 09:39:35AM +0200, Ricky Tigg wrote:
> Hey. Goal: scheduling tasks along with visual output in terminal. I
> concieved it could be achieved under Linux. I had defined a use-case for
> that purpose..
> 
> $ at -q c now + 1 minute
> warning: commands will be executed using /bin/sh
> at> dnf check-update --security | gnome-terminal
> at> 
> job 24 at Thu Feb 27 09:35:00 2020

This is not a bash bug and has nothing to do with bash.

I don't use X and hence know very little about gnome-terminal, but an
ordinary terminal (such as xterm) may take a command to execute with
e.g.

xterm -e 'dnf check-update --security'

Whether this would work with gnome-terminal, I don't know.  I also don't
know whether at would be able to open a terminal window on your display
from one of its jobs.

Note that this is totally unrelated to whatever shell you happen to be
running.

-- 
Andreas (Kusalananda) Kähäri
SciLifeLab, NBIS, ICM
Uppsala University, Sweden

.



Re: bash 5.0.11 – Output not redirected

2020-02-27 Thread Ricky Tigg
there is no track of comments here. See I Andreas Kusalananda K comment.
Not award of all previous comments. Otherwise X was not used; Wayland was
used. Anyway current bug list not appropriate to track software issues.


Re: bash 5.0.11 – Output not redirected

2020-02-27 Thread Greg Wooledge
On Thu, Feb 27, 2020 at 09:39:35AM +0200, Ricky Tigg wrote:
> Hey. Goal: scheduling tasks along with visual output in terminal. I
> concieved it could be achieved under Linux. I had defined a use-case for
> that purpose..
> 
> $ at -q c now + 1 minute
> warning: commands will be executed using /bin/sh
> at> dnf check-update --security | gnome-terminal
> at> 
> job 24 at Thu Feb 27 09:35:00 2020

On Thu, Feb 27, 2020 at 10:55:35AM +0200, Ricky Tigg wrote:
> there is no track of comments here. See I Andreas Kusalananda K comment.
> Not award of all previous comments. Otherwise X was not used; Wayland was
> used. Anyway current bug list not appropriate to track software issues.

So.  You're using GNOME under Wayland, and you want cron or at (or both)
to be able to open terminals on your logged-in display, and run commands
in them.

(I *assume* you want to run commands in these terminals, and not stuff
pre-typed characters into the shell's input buffers, as your original
messages seemed to be saying.)

If it were X11, I might be able to suggest some sort of solution, but
I know almost nothing about Wayland.  You'll have to figure out how
to arrange for your daemonized jobs (at/cron) to find and deliver the
appropriate authentication tokens to Wayland in order to be permitted
to access the display.  You'll also have to figure out how to tell it
the name of the correct display.

Once you've got THAT part figured out, then you can attempt to launch
the terminals which are rigged to run the commands you want them to
run.

It's also not clear whether you want these terminals to run a command
and then freeze up, not closing but not accepting user input -- or
to run the commands and then launch an interactive shell.  The solutions
to the former are highly terminal-emulator-specific.  The solutions
to the latter take two forms, one of which has already been presented
earlier in this thread:

(1) xterm -e bash --rcfile <(cat ~/.bashrc; echo "echo 'X-Y sucks'")

(2) xterm -e sh -c 'echo "X-Y sucks"; exec bash'

Conversion of those forms into gnome-terminal syntax is left as an
exercise for the GNOME users.

There is definitely no bash bug here.  This was a request for help,
and while bash is MARGINALLY involved, the primary issues are operating
system ones.  You'd be better served asking for help on a mailing list
dedicated to Wayland, or to your operating system, or to the use of
Wayland on your operating system, if such a specialized list exists.

Finally, while it appears that English is not your native language,
and I appreciate that you're struggling to communicate, taking a
few moments to lay out the details of your request would help both
you and the people trying to assist you.

Basic background information:

"I'm using Ubuntu 18.04"  or  "I'm using Debian 10.3"  or whatever.

"I'm using GNOME with Wayland."


Basic problem statement:

"I want cron to run gnome-terminal, and I want gnome-terminal to run
a script I wrote."


Nothing fancy.  Just simple statements.

>From there, we can dive into details.  It matters whether the script runs
forever, or terminates.  If the script terminates, we need to know what
you want the terminal to do after the script is finished.  Do you want
it to run an interactive shell, or hang around doing nothing forever,
or hang around for a few seconds and then close, or simply close as soon
as the script exits...?

Other considerations: what happens if you are not logged in at the
time cron starts the job?

What happens if you're logged in to multiple Wayland sessions?  Which
one should it try to use?  Or should it try to use all of them, in
parallel?

What happens if someone *else* is logged in on whatever Wayland's
equivalent of "DISPLAY=:0" is?



Bug: bind -u shell-backward-word does not unbind the binding

2020-02-27 Thread lockywolf
--text follows this line--
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Description:
It is possible to bind shell-backward-word, but not possible to unbind.

 Bash Version: 5.0
 Patch Level: 16
 Release Status: release

Repeat-By:
1) bind '"\e\C-b": shell-backward-word' # make binding
2) bind -P # to check that the binding appeared
3) bind -u shell-backward-word # to unbind the binding
4) bind -P # to check that unbinding didn't work

Fix:
I don't know how to fix the problem.
 Configuration Information [Automatically generated, do not change]:
 Compilation CFLAGS: -O2 -fPIC -Wno-parentheses -Wno-format-security
 uname output: Linux delllaptop.lockywolf.net 5.4.21 #1 SMP Wed Feb 19 19:09:47 
CST 2020 x86_64 Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz GenuineIntel GNU/Linux
 Machine Type: x86_64-slackware-linux-gnu

Date: Thu, 27 Feb 2020 21:39:02 +0800
Message-ID: <87k148jgjt@delllaptop.lockywolf.net>



Re: Bug: bind -u shell-backward-word does not unbind the binding

2020-02-27 Thread Chet Ramey
On 2/27/20 8:40 AM, lockyw...@gmail.com wrote:
> --text follows this line--
> Machine: x86_64
> OS: linux-gnu
> Compiler: gcc
> Description:
>   It is possible to bind shell-backward-word, but not possible to unbind.
> 
>  Bash Version: 5.0
>  Patch Level: 16
>  Release Status: release
> 
> Repeat-By:
> 1) bind '"\e\C-b": shell-backward-word' # make binding
> 2) bind -P # to check that the binding appeared
> 3) bind -u shell-backward-word # to unbind the binding
> 4) bind -P # to check that unbinding didn't work
> 
> Fix:
>   I don't know how to fix the problem.

Well, it's maybe non-obvious. The binding string begins with ESC, which
is by default the meta-prefix for emacs mode. That means you do the key
binding in the `emacs-meta' keymap.

The `-u' option to bind operates on the default keymap, which in emacs
mode is `emacs'.

If you add the `-m emacs-meta' option to your `bind -u' command, you'll
get the results you want.

It might be better if the underlying readline function descended into
keymaps such as emacs-meta rather than operating on a single keymap, but
it doesn't do that right now.


-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRUc...@case.eduhttp://tiswww.cwru.edu/~chet/