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

Re: Help needed piping output to a bash script



> 
> "E.L. Meijer \(Eric\)" <tgakem@sg10.chem.tue.nl> writes:
> 
> > while read line; do
> > echo $line >> $TMPFILE
> > done
> 
> Any special reason for not simply doing
>   cat >> $TMPFILE

Um, yeah, it looks neater :)  I was just mindlessly copying the original
poster's script.  Anyway, you actually still have one superfluous
character there :)

cat > $TMPFILE

is enough, so that the entire  script becomes

------------------------------------------------------------------------
#! /bin/bash

TMPFILE=/tmp/mymore.$$.tmp
cat > $TMPFILE
vi $TMPFILE < /dev/tty
rm -f $TMPFILE
------------------------------------------------------------------------

HTH,
Eric

-- 
 E.L. Meijer (tgakem@chem.tue.nl)          | tel. office +31 40 2472189
 Eindhoven Univ. of Technology             | tel. lab.   +31 40 2475032
 Lab. for Catalysis and Inorg. Chem. (TAK) | tel. fax    +31 40 2455054


Reply to: