How can I invoke an interactive editor in a bash script after piping or
redirecting to it? To illustrate, the script is (eg) vitest:
#!/bin/bash
SCRATCH=/tmp/scratch$$
cat > SCRATCH
vi SCRATCH
If I do
bash$ vitest
Hello
<EOT>
all is well and I can edit the scratch file. However, if I attempt to
use redirection, e.g.,
bash$ echo Hello | vitest
or
bash$ vitest < some.file.or.other
I get an
Input read error
How can I get the redirection or piping to work the way I want it to,
without hacking ps and getting vi to connect explicitly to the terminal?
I feel sure I'm missing something really obvious, but none of the man
pages or FAQs seems to elucidate.
--
mv .sig /dev/null