Re: Incorrect alias expansion within command substitution

2022-02-03 Thread Alex fxmbsw7 Ratchev
On Wed, Feb 2, 2022, 20:43 Robert Elz wrote: > Date:Wed, 2 Feb 2022 11:38:30 -0500 > From:Chet Ramey > Message-ID: <7c422cbb-bba8-0a57-a565-eeb115120...@case.edu> > > > | > How accurately can you reconstitute? That is, can you maintain the > | > difference

Re: Incorrect alias expansion within command substitution

2022-02-03 Thread Chet Ramey
On 2/3/22 3:23 PM, L A Walsh wrote:    In a similar way when one does a 'read var < fn' and you decide to add a warning if 'fn' ended with a binary '0', that would be fine if it only affected you, but you added the warning claiming it was solving some problem complained about by some users.

Re: Incorrect alias expansion within command substitution

2022-02-03 Thread Chet Ramey
On 2/3/22 5:25 PM, Robert Elz wrote: Date:Thu, 3 Feb 2022 16:19:08 -0500 From:Greg Wooledge Message-ID: | This declares the variables at the wrong scope. You are correct - I never normally use "declare" for anything, so I had forgotten that it was

Re: Incorrect alias expansion within command substitution

2022-02-03 Thread Robert Elz
Date:Thu, 3 Feb 2022 16:19:08 -0500 From:Greg Wooledge Message-ID: | This declares the variables at the wrong scope. You are correct - I never normally use "declare" for anything, so I had forgotten that it was essentially a clone of "local" (rather than "local"

Re: Incorrect alias expansion within command substitution

2022-02-03 Thread Chet Ramey
On 2/3/22 4:14 PM, Alex fxmbsw7 Ratchev wrote: alias 0='echo ' 1='$(( ' 2=')) ' data=2+3' ' thats why this doesnt work, or what 0 1 data 2 Come on. This expands to four words: echo $(( 2+3 )) that is not the arithmetic expansion you thought you were looking for. -- ``The lyf so short,

Re: Incorrect alias expansion within command substitution

2022-02-03 Thread Alex fxmbsw7 Ratchev
On Thu, Feb 3, 2022, 20:02 Chet Ramey wrote: > On 2/2/22 1:30 PM, Robert Elz wrote: > > Date:Wed, 2 Feb 2022 11:38:30 -0500 > > From:Chet Ramey > > Message-ID: <7c422cbb-bba8-0a57-a565-eeb115120...@case.edu> > > > > > >| > How accurately can you reconstitute?

Re: Incorrect alias expansion within command substitution

2022-02-03 Thread Alex fxmbsw7 Ratchev
btw u just need a two teee's there one l.int local int ome g.int for with -g and the setting for non g may not be a function On Thu, Feb 3, 2022, 22:28 L A Walsh wrote: > > > On 2022/02/03 11:02, Chet Ramey wrote: > > On 2/2/22 10:18 PM, Robert Elz wrote: > > > >> Date:Wed, 02 Feb

Re: Incorrect alias expansion within command substitution

2022-02-03 Thread Alex fxmbsw7 Ratchev
On Thu, Feb 3, 2022, 22:14 Alex fxmbsw7 Ratchev wrote: > > > On Thu, Feb 3, 2022, 20:02 Chet Ramey wrote: > >> On 2/2/22 1:30 PM, Robert Elz wrote: >> > Date:Wed, 2 Feb 2022 11:38:30 -0500 >> > From:Chet Ramey >> > Message-ID:

Re: Incorrect alias expansion within command substitution

2022-02-03 Thread L A Walsh
On 2022/02/03 11:02, Chet Ramey wrote: On 2/2/22 10:18 PM, Robert Elz wrote: Date:Wed, 02 Feb 2022 17:18:08 -0800 From:L A Walsh Message-ID: <61fb2d50.7010...@tlinx.org> | My posix non-conformance issue has to do with bash not starting with |

Re: Incorrect alias expansion within command substitution

2022-02-03 Thread Robert Elz
Date:Thu, 3 Feb 2022 13:31:52 -0500 From:Chet Ramey Message-ID: <46753625-7fcc-8296-c31e-7a5d1fc38...@case.edu> | My argument is like yours -- is there a return on the investment of effort | to make it worth doing, if the current state preserves semantics? Sure,

Re: Incorrect alias expansion within command substitution

2022-02-03 Thread Greg Wooledge
On Fri, Feb 04, 2022 at 02:52:34AM +0700, Robert Elz wrote: > You could instead use: > > my() > { > local A= > while [ $# -gt 0 ] > do > case "$1" in > int)A="${A} -i";; >

Re: Incorrect alias expansion within command substitution

2022-02-03 Thread Robert Elz
Date:Thu, 03 Feb 2022 09:05:53 -0800 From:L A Walsh Message-ID: <61fc0b71.2080...@tlinx.org> | There is no way you can tell me that: | declare var='v' | declare -i ivar=1 | | are more clear than: | | my var='v' | int ivar=1 I can, easily -- for the

Re: Incorrect alias expansion within command substitution

2022-02-03 Thread Chet Ramey
On 2/2/22 10:18 PM, Robert Elz wrote: Date:Wed, 02 Feb 2022 17:18:08 -0800 From:L A Walsh Message-ID: <61fb2d50.7010...@tlinx.org> | My posix non-conformance issue has to do with bash not starting with | aliases enabled by default in all default

Re: Incorrect alias expansion within command substitution

2022-02-03 Thread Chet Ramey
On 2/2/22 8:18 PM, L A Walsh wrote: However w/r/t starting with aliases being enabled by default when bash starts (interactive or not), I would prefer bash follow posix rules. You have a preference that can easily be satisfied by running bash with the appropriate option enabled. It's not a

Re: Incorrect alias expansion within command substitution

2022-02-03 Thread Chet Ramey
On 2/3/22 12:05 PM, L A Walsh wrote:     There's no need for it, it just makes your script harder to     follow. ---    I write scripts for myself.  aliases make scriptes easier to create modify and maintain.  You can type 'declare -i x=1', I prefer 'int x=1' I find 'declare -xxyz' harder to

Re: Incorrect alias expansion within command substitution

2022-02-03 Thread Chet Ramey
On 2/2/22 1:30 PM, Robert Elz wrote: Date:Wed, 2 Feb 2022 11:38:30 -0500 From:Chet Ramey Message-ID: <7c422cbb-bba8-0a57-a565-eeb115120...@case.edu> | > How accurately can you reconstitute? That is, can you maintain the | > difference between $(a b) and

Re: Incorrect alias expansion within command substitution

2022-02-03 Thread Alex fxmbsw7 Ratchev
On Thu, Feb 3, 2022, 18:16 Dennis Williamson wrote: > > > On Thu, Feb 3, 2022, 11:14 AM Alex fxmbsw7 Ratchev > wrote: > >> aliases are the way not to write duplicate code >> >> > > > No, functions are. > im your dreams.. >

Re: Incorrect alias expansion within command substitution

2022-02-03 Thread Dennis Williamson
On Thu, Feb 3, 2022, 11:14 AM Alex fxmbsw7 Ratchev wrote: > aliases are the way not to write duplicate code > > No, functions are. >

Re: Incorrect alias expansion within command substitution

2022-02-03 Thread L A Walsh
On 2022/02/03 07:02, Alex fxmbsw7 Ratchev wrote: On Thu, Feb 3, 2022, 04:20 Robert Elz > wrote: Date:Wed, 02 Feb 2022 17:18:08 -0800 From:L A Walsh mailto:b...@tlinx.org>> Message-ID: <61fb2d50.7010...@tlinx.org

Re: Incorrect alias expansion within command substitution

2022-02-03 Thread Alex fxmbsw7 Ratchev
aliases are the way not to write duplicate code On Thu, Feb 3, 2022, 18:06 L A Walsh wrote: > > > On 2022/02/03 07:02, Alex fxmbsw7 Ratchev wrote: > > > > > > On Thu, Feb 3, 2022, 04:20 Robert Elz > > wrote: > > > > Date:Wed, 02 Feb 2022 17:18:08

Re: Process substitution as part of a word [was: Incorrect alias expansion ...]

2022-02-03 Thread Chet Ramey
On 2/3/22 9:09 AM, Martijn Dekker wrote: Op 02-02-22 om 20:59 schreef Chet Ramey: [...] it makes no sense to join a process substitution to another word. But it does. In arguments that look like assignments, and in GNU-style long options, file names can be part of a larger word. You're

Re: Incorrect alias expansion within command substitution

2022-02-03 Thread Alex fxmbsw7 Ratchev
On Thu, Feb 3, 2022, 04:20 Robert Elz wrote: > Date:Wed, 02 Feb 2022 17:18:08 -0800 > From:L A Walsh > Message-ID: <61fb2d50.7010...@tlinx.org> > > | My posix non-conformance issue has to do with bash not starting with > | aliases enabled by default in all

Process substitution as part of a word [was: Incorrect alias expansion ...]

2022-02-03 Thread Martijn Dekker
Op 02-02-22 om 20:59 schreef Chet Ramey: [...] it makes no sense to join a process substitution to another word. But it does. In arguments that look like assignments, and in GNU-style long options, file names can be part of a larger word. Assuming tar is GNU tar, something like tar -c