1 |
On 2017-07-29 20:07, Grant Edwards wrote: |
2 |
|
3 |
> > Correct. All my scripts run with IFS='' so for me it does work ;-) |
4 |
> |
5 |
> Ah, I hadn't thought about that. I might have to thy that. It makes |
6 |
> code cleaner-looking when you don't have to put all varible references |
7 |
> inside double-quotes. But, in what ways is it going to trip me up |
8 |
> after all these decades of writing shell scripts the old way? |
9 |
|
10 |
Well, anywhere you expand an unquoted variable, or command output via `` |
11 |
or $(), and depend on it being split into separate words. |
12 |
|
13 |
I now religiously use this idiom: |
14 |
|
15 |
ifson ; set -- $( foo ) ; ifsoff |
16 |
|
17 |
for x ; do bar $x ; done |
18 |
|
19 |
to act on separate words output from foo. |
20 |
|
21 |
Basically, I am trying to make my sh(1) scripts look like rc(1) scripts, |
22 |
without the rc bugs and missing features. |
23 |
|
24 |
-- |
25 |
Please don't Cc: me privately on mailing lists and Usenet, |
26 |
if you also post the followup to the list or newsgroup. |
27 |
Do obvious transformation on domain to reply privately _only_ on Usenet. |