Re: Unset array doesn't work

2018-02-26 Thread Clark Wang
On Mon, Feb 26, 2018 at 11:07 PM, Greg Wooledge wrote: > On Mon, Feb 26, 2018 at 09:57:10AM -0500, Clint Hepner wrote: > > If necessary, you can define a global (at the expense of a single > subprocess) > > > > myIFS=$(printf ' \t\n') > > That actually won't work,

Re: Unset array doesn't work

2018-02-26 Thread Robert Elz
Date:Mon, 12 Feb 2018 09:26:37 -0500 From:Chet Ramey Message-ID: <790ade74-690f-541c-9ab4-635991744...@case.edu> | This is bash's dynamic scoping. The visibility of a local variable is | restricted to a function and its children, and `unset'

Re: Unset array doesn't work

2018-02-26 Thread Robert Elz
Date:Tue, 27 Feb 2018 10:18:24 +0800 From:Clark Wang Message-ID:

Re: Unset array doesn't work

2018-02-26 Thread Clint Hepner
> On 2018 Feb 26 , at 4:31 a, Robert Elz wrote: > >Date:Mon, 12 Feb 2018 09:26:37 -0500 >From:Chet Ramey >Message-ID: <790ade74-690f-541c-9ab4-635991744...@case.edu> > > | This is bash's dynamic scoping. The visibility of

Re: Unset array doesn't work

2018-02-26 Thread Greg Wooledge
On Mon, Feb 26, 2018 at 09:57:10AM -0500, Clint Hepner wrote: > If necessary, you can define a global (at the expense of a single subprocess) > > myIFS=$(printf ' \t\n') That actually won't work, because $(...) strips the trailing newline(s). This might work: myIFS=$(printf ' \t\nx')

Re: Function definitions

2018-02-26 Thread moosotc
Chet Ramey writes: > On 2/26/18 5:45 AM, moos...@gmail.com wrote: > >> Bash Version: 4.4 >> Patch Level: 19 >> Release Status: release >> >> Description: >> Bash rejects valid function definitions >> >> Repeat-By: >> >> $ func() true >> bash: syntax error near

Re: Function definitions

2018-02-26 Thread moosotc
Pierre Gaston writes: > On Mon, Feb 26, 2018 at 12:45 PM, wrote: > [..snip..] >> >> $ func() true >> bash: syntax error near unexpected token `true' >> >> # Variant#2 >> $ func() { true } >> > ^C >> >> Both forms seem to be valid per [1] and are

Re: Function definitions

2018-02-26 Thread Chet Ramey
> Chet Ramey writes: > Thank you for an explanation. My takeaway is that most, if not all, > [kaz]sh descendants[1] allow something that IEEE Std 1003.1-2008, 2016 > Edition doesn't. Yep, nothing wrong with that. All shells include extensions beyond what Posix specifies.

Re: Function definitions

2018-02-26 Thread Chet Ramey
On 2/26/18 5:45 AM, moos...@gmail.com wrote: > Bash Version: 4.4 > Patch Level: 19 > Release Status: release > > Description: > Bash rejects valid function definitions > > Repeat-By: > > $ func() true > bash: syntax error near unexpected token `true' Yes, bash requires that function

Re: How to apply Bash completion usefully and more practically

2018-02-26 Thread Chet Ramey
On 2/25/18 5:01 AM, Budi wrote: > How to apply Bash completion in more useful way. > If TAB key is pressed Bash just show a list of corresponding command, I > thought it will scroll over all corresponding command on which the cursor > of shell prompt is active. (just like traditional Windows cmd

Function definitions

2018-02-26 Thread moosotc
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-unknown-linux-gnu' -DCONF_VENDOR='unknown'

Re: Function definitions

2018-02-26 Thread Pierre Gaston
On Mon, Feb 26, 2018 at 12:45 PM, wrote: > > Configuration Information [Automatically generated, do not change]: > Machine: x86_64 > OS: linux-gnu > Compiler: gcc > Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' > -DCONF_OSTYPE='linux-gnu'

Re: Unset array doesn't work

2018-02-26 Thread Robert Elz
Date:Mon, 26 Feb 2018 09:57:10 -0500 From:Clint Hepner Message-ID: | As you say, the intent is to use a particular value of the variable. The fact that unsetting | IFS causes it to use a