|
From: | Marco Ippolito |
Subject: | Re: quote interpretation via vars without eval |
Date: | Mon, 15 Mar 2021 16:55:25 -0300 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 |
On 15/03/2021 16:39, Greg Wooledge wrote:
On Mon, Mar 15, 2021 at 08:28:24PM +0100, Alex fxmbsw7 Ratchev wrote:btw greycat if you didnt watch it was command ls --quoting-style=shell-escape -cF ( | awk .. )The ParsingLs wiki page does mention this, at the bottom. It's a recent addition to GNU coreutils, and as such is extremely non-portable. And requires the use of eval, *and* the use of bash (not sh). Every other use of ls's output in a script is wrong. If your script isn't a bash script, it's wrong. If your system isn't using GNU coreutils, it's wrong. If your version of GNU coreutils is older than ~2016, it's wrong.
Interestingly, I checked and Debian Jessie (currently oldoldstable) uses package coreutils_8.23-4 which does have a < 2016 ls.
Now, Long Term Support ended for it (i.e. voluntary security support for it beyond oldstable) in mid 2020 so maybe a system with such an old coreutils installation, likely not getting any security updates unless they are applied in-house or through an interest group, perhaps has a bigger problem, but I'd be curious to know how many production systems out there are kept this backwards.
[Prev in Thread] | Current Thread | [Next in Thread] |