Sujet : Re: Splitting in shell (bash)
De : jerry (at) *nospam* example.invalid (Jerry Peters)
Groupes : comp.unix.shellDate : 17. Nov 2024, 01:43:31
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vhbe7j$9aag$1@dont-email.me>
References : 1 2 3
User-Agent : tin/2.4.5-20201224 ("Glen Albyn") (Linux/6.6.61 (x86_64))
Lawrence D'Oliveiro <
ldo@nz.invalid> wrote:
On Sun, 10 Nov 2024 00:51:58 -0000 (UTC), Lem Novantotto wrote:
But you could have more using IFS.
IFS is the way to go.
If you want your change to IFS to be only temporary, you can restrict it
to a subshell by putting the code sequence in ???( ... )???. But then you
cannot pass variables back to the parent shell.
Another option is to use a coproc command.
Or put it in a function and declare IFS local.
~$ xxx () { local IFS="$IFS|" ; echo "$IFS" ; }
~$ xxx
|
~$ echo $IFS