Re: Request change to output of declare -f funcname

2021-10-03 Thread Chet Ramey
On 10/2/21 1:02 PM, Léa Gris wrote: Le 02/10/2021 à 18:45, Greg Wooledge écrivait : On Sat, Oct 02, 2021 at 06:06:32PM +0200, Léa Gris wrote: Better illustrated how newlines are discarded: $ sudo bash -c 'echo hello echo world' hello world $ sudo -i bash -c 'echo hello echo world' helloech

Re: Request change to output of declare -f funcname

2021-10-02 Thread Oğuz
On Sat, Oct 2, 2021 at 7:54 PM Andreas Kusalananda Kähäri wrote: > I don't think their issue is that the output from declare -f is ever > invalid as such, but that their usage of the resulting text involves > replacing newlines with spaces, which turns it into invalid shell code. Not spaces, but b

Re: Request change to output of declare -f funcname

2021-10-02 Thread Léa Gris
Le 02/10/2021 à 18:45, Greg Wooledge écrivait : On Sat, Oct 02, 2021 at 06:06:32PM +0200, Léa Gris wrote: Better illustrated how newlines are discarded: $ sudo bash -c 'echo hello echo world' hello world $ sudo -i bash -c 'echo hello echo world' helloecho world OK, that's news to me. But

Re: Request change to output of declare -f funcname

2021-10-02 Thread Andreas Kusalananda Kähäri
On Sat, Oct 02, 2021 at 09:09:39AM -0400, Greg Wooledge wrote: > On Sat, Oct 02, 2021 at 01:41:35PM +0200, Léa Gris wrote: > > $ declare -f hello > > > > hello () > > { > > echo 'hello'; > > echo 'world' > > } > > > > The issue is that in some circumstances, newline characters may be hand

Re: Request change to output of declare -f funcname

2021-10-02 Thread Greg Wooledge
On Sat, Oct 02, 2021 at 06:06:32PM +0200, Léa Gris wrote: > Better illustrated how newlines are discarded: > > $ sudo bash -c 'echo hello > echo world' > > hello > > world > > $ sudo -i bash -c 'echo hello > echo world' > > helloecho world OK, that's news to me. But that looks like a bug in sud

Re: Request change to output of declare -f funcname

2021-10-02 Thread Léa Gris
Le 02/10/2021 à 15:09, Greg Wooledge écrivait : On Sat, Oct 02, 2021 at 01:41:35PM +0200, Léa Gris wrote: $ declare -f hello hello () { echo 'hello'; echo 'world' } The issue is that in some circumstances, newline characters may be handled as space, making the function declaration in

Re: Request change to output of declare -f funcname

2021-10-02 Thread Alex fxmbsw7 Ratchev
there are many paste boards and preview systems that cripple newlines to spaces the dude that posted the issue wrote about that case, \n to ' ' On Sat, Oct 2, 2021, 17:08 Greg Wooledge wrote: > On Sat, Oct 02, 2021 at 04:52:38PM +0200, Alex fxmbsw7 Ratchev wrote: > > in pasted mails where newlin

Re: Request change to output of declare -f funcname

2021-10-02 Thread Greg Wooledge
On Sat, Oct 02, 2021 at 04:52:38PM +0200, Alex fxmbsw7 Ratchev wrote: > in pasted mails where newlines get converted to spaces > > On Sat, Oct 2, 2021, 15:21 Greg Wooledge wrote: > > > On Sat, Oct 02, 2021 at 01:41:35PM +0200, Léa Gris wrote: > > > $ declare -f hello > > > > > > hello () > > > {

Re: Request change to output of declare -f funcname

2021-10-02 Thread Alex fxmbsw7 Ratchev
in pasted mails where newlines get converted to spaces On Sat, Oct 2, 2021, 15:21 Greg Wooledge wrote: > On Sat, Oct 02, 2021 at 01:41:35PM +0200, Léa Gris wrote: > > $ declare -f hello > > > > hello () > > { > > echo 'hello'; > > echo 'world' > > } > > > > The issue is that in some circ

Re: Request change to output of declare -f funcname

2021-10-02 Thread Greg Wooledge
On Sat, Oct 02, 2021 at 01:41:35PM +0200, Léa Gris wrote: > $ declare -f hello > > hello () > { > echo 'hello'; > echo 'world' > } > > The issue is that in some circumstances, newline characters may be handled > as space, making the function declaration invalid. Can you show an example w