bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (question) fast split/join of strings


From: Greg Wooledge
Subject: Re: (question) fast split/join of strings
Date: Tue, 17 Sep 2024 12:02:03 -0400

On Tue, Sep 17, 2024 at 17:00:16 +0200, alex xmb sw ratchev wrote:
> plz what does 'local -' do , its newer to me
> i forgot all about it already

       local [option] [name[=value] ... | - ]
              For  each  argument, a local variable named name is created, and
              assigned value.  The option can be any of the  options  accepted
              by declare.  When local is used within a function, it causes the
              variable name to have a visible scope restricted to  that  func‐
              tion  and  its children.  If name is -, the set of shell options
              is made local to the function in which local is  invoked:  shell
              options  changed  using  the set builtin inside the function are
              restored to their original values  when  the  function  returns.

It's supposed to let you make things like "set -f" local to the function
in which they appear.  I've never actually used it yet.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]