[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RFC: turn off word splitting for vars but keep for read
From: |
Aleksey Midenkov |
Subject: |
RFC: turn off word splitting for vars but keep for read |
Date: |
Fri, 22 Nov 2013 10:00:28 +0400 |
Since word splitting in vars is used not more frequently than never,
protecting all vars in scripts with double quotes is quite unpleasant
thing. Therefore, I want exactly this behavior always to be in my
scripts:
$ IFS=""
$ f() { echo $1; }; x="a b c"; f $x
a b c
But, IFS influences `read`, which of course benefits from word
splitting. In light of that conflict, I propose two possible
solutions:
1: shopt -s unsplit_vars
which will turn off word splitting for var expansion.
or 2: new IFS2 var that will override IFS for `read` (i.e. `read` will
use IFS2 when IFS is unset).
- RFC: turn off word splitting for vars but keep for read,
Aleksey Midenkov <=
- Re: RFC: turn off word splitting for vars but keep for read, Pierre Gaston, 2013/11/22
- Re: RFC: turn off word splitting for vars but keep for read, Aleksey Midenkov, 2013/11/22
- Re: RFC: turn off word splitting for vars but keep for read, Eric Blake, 2013/11/22
- Re: RFC: turn off word splitting for vars but keep for read, Pierre Gaston, 2013/11/22
- Re: RFC: turn off word splitting for vars but keep for read, Aleksey Midenkov, 2013/11/22
- Re: RFC: turn off word splitting for vars but keep for read, Bob Proulx, 2013/11/24
- Re: RFC: turn off word splitting for vars but keep for read, Greg Wooledge, 2013/11/25
- Re: RFC: turn off word splitting for vars but keep for read, Bob Proulx, 2013/11/25
- Re: RFC: turn off word splitting for vars but keep for read, Eduardo A . Bustamante López, 2013/11/22
Re: RFC: turn off word splitting for vars but keep for read, Greg Wooledge, 2013/11/22