gnu-arch-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnu-arch-users] Trying out the new escaping version...


From: Pierce T . Wetter III
Subject: Re: [Gnu-arch-users] Trying out the new escaping version...
Date: Thu, 18 Mar 2004 08:06:02 -0700

I think that the solution now supports the needs of most users and is
easy to handle. I am open to any suggestion how to make impossible
things happen, just tell me.

 Well, first off, I'm really glad you did all this work.

Second, I think your instincts were right, and Tom's were wrong. \ escaping would have been better. Hopefully, its possible to easily change the escaping mechanism.

I base this not on _theory_ but on practice with trying to import this website a customer gave me that has godawful naming conventions.

 Here's what I've found.

 Let's say you have a directory of files:

  "bad example.html"
  "worse example .html"
  "bad dir/bad example.html"

 With Pika escaping, you might think you could do this:

  tla add bad\(sp)example.html

  Nope. You have to do:

  tla add bad\\\(sp\)example.html

Because the shell really wants to eat those \, and doesn't like () either...

  So it turns out that:

  tla add bad\ example.html
  tla add "bad example.html"

  Is actually easier!

  tla add *

  is easiest of all...

  That's adding one file. Let's try to add them all.

  tla tree-lint -t

  will output

  bad\(sp)example.html
  worse\(sp)example\(sp).html
  bad\(sp)dir/bad\(sp)example.html

 tla tree-lint --unescaped -t

  will output

  bad example.html
  worse example .html
  bad dir/bad example.html

 tla tree-lint -t | xargs -p -I % tla add %

  Will try to do:

  tla add bad(sp)example.html

  because xargs ate the \..

  tla tree-lint -t --unescaped | xargs -p -I % tla add \"%\"

  Will try to do:

  tla add "bad
  tla add example.html"

Various of the for loops that people have proposed have the same problem. And to be as blunt as possible, if you have to write a for loop to use a tool, the tool is seriously broken.

So in short, pika escaping may be theoretically good, but in the harsh light of practice, I find it almost useless. It has the worst of all choices in that it uses backslash, a character that almost all shells or scripting languages interpret even in quotes, but then uses it in a "new" way. Then it adds (), which shells also try to interpret. So it just doesn't work how its being used.

It's pointless to complain about the shell. tla is a command line tool, therefore it is an extension of the shell. It has to play in the shell's sandbox. If I have to use the shells escaping method from the command line, and pika internally with tla, I've now had to learn TWO escaping methods.

Forcing me to learn yet another escaping method has a high annoyance cost. Forcing me to learn another escaping method that has made such bad choices that I have to re-escape ALL of its delimiters in the shell's escaping method is even more arrogant.

  <getting out the bludgeon>

escaping is great, thank you. pika escaping is broken. None of you can argue otherwise, EVEN TOM, until you actually try to use it. Here's a sample project
  for you:

  mkdir "pika escaping sucks"
  cd "pika escaping sucks"
  touch "yes it really does"
  mkdir 'theory is !(practice)'
  cd 'theory is !(practice)'
  touch 'quotes " are good"
  touch 'aren\'t they'

Now add those using tree-lint. Done that? Now repeat for csh, ksh, zsh, bash...

  ixnay on the ikapay scapingay

 Pierce





reply via email to

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