find . -name "pom.xml" | awk '{print "bad " $1 > "/dev/stderr"}' | vi -

then issuing ls to no avail

iff I issue

find . -name "pom.xml" | awk '{print "bad " $1 > "/dev/stderr"}' 2> session ; vi -S session
[cut]
I think I'm missing a point somewhere, can you think of anyway to skip the intermediary session file?

At least OpenBSD's xargs allows you to reopen stdin with

        find . -name "pom.xml" | xargs -o vi

This is a fabulous feature, though checking several Linux installs I have access to, none of their "xargs" offer a "-o" parameter to reopen stdin. If you happen to be running on OpenBSD (or perhaps the FreeBSD/NetBSD/Dragonfly offer similar functionality), this is an elegant solution with no warts.

In a bash shell where you can create dynamic FIFOs as pseudo-files, you might be able to get away with

  vi -S <(find . -name "pom.xml" | sed 's/^/bad /')

(using sed rather than Awk, as I'm not sure I understand the complications about stdout vs. stderr in your example). This may come with the wart of an empty buffer (the starting buffer) in addition to all the "bad"ded buffers. This wart could be worked around with some ugliness:

vi -S <(find . -name "pom.xml" | sed -e '1s/^/e /' -e '1!s/^/bad ')

which changes the first session command into "e" rather than "bad".

None of these solutions leave intermediate session-files around.

Just a few ideas...

-tim



Reply via email to