Deutsch English Français Italiano |
<vhbe7j$9aag$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!weretis.net!feeder9.news.weretis.net!news.quux.org!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Jerry Peters <jerry@example.invalid> Newsgroups: comp.unix.shell Subject: Re: Splitting in shell (bash) Date: Sun, 17 Nov 2024 00:43:31 -0000 (UTC) Organization: A noiseless patient Spider Lines: 21 Message-ID: <vhbe7j$9aag$1@dont-email.me> References: <vgo225$91aq$1@news.xmission.com> <vgp03e$iqq$1@dont-email.me> <vgp22t$268r$1@dont-email.me> Injection-Date: Sun, 17 Nov 2024 01:43:33 +0100 (CET) Injection-Info: dont-email.me; posting-host="eb164ba1c11e2b3c727b469ac2942a4e"; logging-data="305488"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+XGXy+27aZb6fdGsJm0fz7gl37k/GvxVw=" User-Agent: tin/2.4.5-20201224 ("Glen Albyn") (Linux/6.6.61 (x86_64)) Cancel-Lock: sha1:weYwJRQt5+eWq5gv6zQqzXnYo+I= Bytes: 1534 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