Web lists-archives.com

Re: Bash file to variable string problem -- must be simple. What am I missing?




Hi,

i wrote:
> > if spaces are involved, then quotation marks should be put around the
> > argument of "echo".

David Wright wrote:
> Yep. But I guess we're solving Problem A, the subject line's
> reported paradox (which was never actually demonstrated),
> rather than Problem B, which wasn't revealed until the
> OP's follow-up.

deb wrote originally:
> > > # THIS LS FAILS, WITH FILE NOT FOUND (but actually reports the exact string
> > > that worked above, but not being found here).

This is of course impossible in a deterministic world.
So either black magic, quantum logic, or non-identical strings are at work.
I bet on eye spoofing by blanks and maybe a proportional text font.


> Letting the shell parse and reparse is rarely a good idea
> and can lead to quoting hell, necessitating a visit to one
> of Greg's wikis.

I think my theory could be classified as a simplifying merger of
  https://mywiki.wooledge.org/BashPitfalls#for_f_in_.24.28ls_.2A.mp3.29
and
  https://mywiki.wooledge.org/BashPitfalls#echo_.24foo


Have a nice day :)

Thomas