Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: question mark in filename.



On Sun, Jan 10, 2021 at 4:04 PM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>
> And now we know that 'ls' replaces linefeeds with question marks, thanks Richard Stallman.

It does that only when stdout is a tty. The output in this mode has
been improved recently. Here's what I get:

  % ls
  's,7,big'$'\n''improvements'$'\n''in'$'\n''code'$'\n'

  % ls | cat
  s,7,big
  improvements
  in
  code

> But then again 'eval' uses question marks the first time

That's just the output of `ls` when stdout is a tty.

> ... and spaces the second

This time stdout of `ls` is not a tty, so it prints the file name
verbatim. After that your code splits the output on IFS and joins it
back together with spaces. It's WAI.

Roman.




Messages sorted by: Reverse Date, Date, Thread, Author