Re: Splitting in shell (bash)

Liste des GroupesRevenir à cu shell 
Sujet : Re: Splitting in shell (bash)
De : jerry (at) *nospam* example.invalid (Jerry Peters)
Groupes : comp.unix.shell
Date : 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



Date Sujet#  Auteur
9 Nov 24 * Splitting in shell (bash)11Kenny McCormack
10 Nov 24 +* Re: Splitting in shell (bash)4Lem Novantotto
10 Nov 24 i`* Re: Splitting in shell (bash)3Lawrence D'Oliveiro
10 Nov 24 i +- Re: Splitting in shell (bash)1Lem Novantotto
17 Nov 24 i `- Re: Splitting in shell (bash)1Jerry Peters
10 Nov 24 `* Re: Splitting in shell (bash)6Kenny McCormack
10 Nov 24  `* Re: Splitting in shell (bash)5Axel Reichert
10 Nov 24   +* Re: Splitting in shell (bash)3Janis Papanagnou
10 Nov 24   i`* Re: Splitting in shell (bash)2Kenny McCormack
10 Nov 24   i `- Re: Splitting in shell (bash)1Janis Papanagnou
9 Dec 24   `- Re: Splitting in shell (bash)1Kenny McCormack

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal