Re: Feature request

2022-01-13 Thread Matthew Persico
> > On 1/11/22 6:24 AM, Tathastu Pandya via Bug reports for the GNU Bourne > Again SHell wrote: > > Just as PROMPT COMMAND thats get executed every time before any commamd. > Is there a way to execute predefined command after every command is > executedeg. Automatically record the exit status of cu

bug-bash@gnu.org

2022-01-13 Thread Koichi Murase
> --- a/CHANGES > +++ b/CHANGES > @@ -1,3 +1,326 @@ > +This document details the changes between this version, bash-5.2-alpha, and > +the previous version, bash-5.1-release. > > [...] > > +x. New shell option: patsub_replacement. When enabled, a `&' in the > replacement > + string of the pattern

Re: A bug when using bash shell variable

2022-01-13 Thread ju nan
ok, I will try this. I am even a little excited when I found this "bug" 😜, but it turns out I should learn more details about bash :P Get Outlook for Android From: Andreas Kusalananda Kähäri Sent: Thursday, January 13, 2022 7:04:16 PM To:

Re: A bug when using bash shell variable

2022-01-13 Thread Andreas Kusalananda Kähäri
On Thu, Jan 13, 2022 at 11:55:45AM +0100, Kusalananda Kähäri wrote: > > When you want to store several separate arguments, do not combine them > into a single string. > > Compare this > > args="-a 'hello world' -b '1 * 3'" > printf '"%s"\n' $args > > and > > args=( -a 'hello

Re: A bug when using bash shell variable

2022-01-13 Thread Andreas Kusalananda Kähäri
When you want to store several separate arguments, do not combine them into a single string. Compare this args="-a 'hello world' -b '1 * 3'" printf '"%s"\n' $args and args=( -a 'hello world' -b '1 * 3' ) printf '"%s"\n' "${args[@]}" Using an unquoted variable

Re: A bug when using bash shell variable

2022-01-13 Thread ju nan
Ok, thank you so much for this solution😇 Get Outlook for Android From: Alex fxmbsw7 Ratchev Sent: Thursday, January 13, 2022 6:45:03 PM To: ju nan Cc: yesxorno via Bug reports for the GNU Bourne Again SHell Subject: Re: A bug when using b

Re: A bug when using bash shell variable

2022-01-13 Thread Alex fxmbsw7 Ratchev
in other words shell separates between spaces and quotes u need quoting right, otherwise its flat args or one arg if quoted not right arr=( -arg{1,2,3} ) cmd "${arr[@]}" tells to pass every arr member with quotes On Thu, Jan 13, 2022, 11:42 Alex fxmbsw7 Ratchev wrote: > args=( -append "opt wit

Re: A bug when using bash shell variable

2022-01-13 Thread Alex fxmbsw7 Ratchev
args=( -append "opt with spaces" ) cmd "${args[@]}" other_arg On Thu, Jan 13, 2022, 11:33 ju nan wrote: > I hava run into some troubles when I use bash shell to execute qemu, here > is the log. > > > > 1. Run qemu with arguments directly in bash shell, I use strace to > track execve syscall,

A bug when using bash shell variable

2022-01-13 Thread ju nan
I hava run into some troubles when I use bash shell to execute qemu, here is the log. 1. Run qemu with arguments directly in bash shell, I use strace to track execve syscall, everything goes well junan@u0:~/Documents/coding/run-riscv-qemu-linux$ strace qemu-system-riscv64 -nographic -mach