> a) ls -a 2>/dev/null | f?grep ^%s

Of course, it's better to use `grep ^%s' than `fgrep %s' since it solves
both the leading dash and the substring issue, but then you have to
carefully requote your string.

Maybe something like:

        (format "%s -a 2>/dev/null | grep ^%s"
                (tramp-get-ls-command multi-method method user host)
                (tramp-shell-quote-argument
                 (replace-regexp-in-string "[[*$^.\\]" "\\\\\\&" filename)))

I believe that . \ ^ $ [ and * are the only special chars in grep.
It's important not to quote too much here, since GNU grep gives special
meaning to \{ \+ \? \w \< ...

As for the `find .' case my earlier example forgot to requote the \ itself.


        Stefan

Reply via email to