help-bash
[Top][All Lists]
Advanced

[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:28:24 +0100

right it wasnt the output however it prints it as ? excepts | cat etc yea
.. i cannot agree anymore to ls being useless
especially after looking at its man page

to detail the find \ ls issue
i build a multiline prompt, one line recent dirs one line recent files
that means recent... modification time, i tried find, i tried stat, ls is
best suited for this ( its already working ) - pasted [attached] already

by recents mean parsing finds or stats output, sort -n, awk .. and the
problem was the filename contained ?, even worse if it was empty like non
\1 or \001, or stat didnt have subsecond mod time showment ( ? )

im quite happy with the ls output, excepts \001 has to be shortened and the
'' cut away

btw greycat if you didnt watch it was command ls
--quoting-style=shell-escape -cF ( | awk .. )

On Mon, Mar 15, 2021 at 8:06 PM Greg Wooledge <greg@wooledge.org> wrote:

> On Mon, Mar 15, 2021 at 07:33:07PM +0100, Alex fxmbsw7 Ratchev wrote:
> > cd /tmp ; >$'\1' ; find $'\1'
> > ./?
>
> One: you didn't check the result of cd.  But I guess this is just being
> done in an interactive shell, not a script, so OK.
>
> Two: your output does not match the command you gave.
>
> unicorn:~/tmp$ touch $'\1'; find $'\1'
> ?
>
> There is no leading ./ in the output, at least with my particular version
> of GNU find.  Maybe yours is vastly different, but it's more likely that
> you didn't paste an actual command-and-output pair, but instead, decided
> to fake it.  Please don't do that.  It isn't helpful.
>
> Three: GNU find is trying to protect you by changing the output when
> the output is going to a terminal.
>
> unicorn:~/tmp$ touch $'\1'; find $'\1' | od -tx1 -An
>  01 0a
> unicorn:~/tmp$ touch $'\1'; find $'\1' | cat
>
> unicorn:~/tmp$
>
> The ? output is no longer shown, because find's output isn't going to
> a terminal.
>
> > ls displays it as
> > ''$'\001'
>
> ls's output is notoriously useless.  We have a whole wiki page on this
> topic.  You know this.
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]