[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: quote interpretation via vars without eval
From: |
Alex fxmbsw7 Ratchev |
Subject: |
Re: quote interpretation via vars without eval |
Date: |
Mon, 15 Mar 2021 20:57:42 +0100 |
well, i cannot expect it to run on AIX or something
only on non stable debian like mines, i dont propose it
in cases i setup servers, with also unstable debian, and code the same there
.. :)
also two topics about that shell-escape
i choosed this one cause it did most reasonable view-results
i need it for flat txt display on the prompt so i awk it to this, no problem
in contraverse of needing eval
i learnt off this list, i dont need eval to make quotes interpreted, at
least in var assignments, ...i build a string and declare [opts] "$str" and
it works
lemme try..
cd /tmp ; >$'\1' ; files=$( ls --quoting-style=shell-escape $'\1' )
files='files=( '$files' )' ; declare -a "$files" ; declare -p files
declare -a files=([0]=$'\001')
1. str with quotes, space separated
2 surround with var=( and )
3. right declare opts the "$full_str"
peace
On Mon, Mar 15, 2021 at 8:39 PM Greg Wooledge <greg@wooledge.org> 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.
>
>
- Re: quote interpretation via vars without eval, (continued)
- Re: quote interpretation via vars without eval, Koichi Murase, 2021/03/14
- Re: quote interpretation via vars without eval, Alex fxmbsw7 Ratchev, 2021/03/14
- Re: quote interpretation via vars without eval, Koichi Murase, 2021/03/15
- Re: quote interpretation via vars without eval, Alex fxmbsw7 Ratchev, 2021/03/15
- Re: quote interpretation via vars without eval, Greg Wooledge, 2021/03/15
- Re: quote interpretation via vars without eval, Alex fxmbsw7 Ratchev, 2021/03/15
- Re: quote interpretation via vars without eval, Greg Wooledge, 2021/03/15
- Re: quote interpretation via vars without eval, Marco Ippolito, 2021/03/15
- Re: quote interpretation via vars without eval, Greg Wooledge, 2021/03/15
- Re: quote interpretation via vars without eval, Alex fxmbsw7 Ratchev, 2021/03/15
- Re: quote interpretation via vars without eval,
Alex fxmbsw7 Ratchev <=
- Re: quote interpretation via vars without eval, Greg Wooledge, 2021/03/15
- Re: quote interpretation via vars without eval, Alex fxmbsw7 Ratchev, 2021/03/15
- Re: quote interpretation via vars without eval, Koichi Murase, 2021/03/15
Re: quote interpretation via vars without eval, Chet Ramey, 2021/03/13