Phill Coxon wrote:
Steve sent me this which works great.

Thanks Nick & Rex for your suggestions to.

I can't resist posting another couple of options. In sed, it's a one-liner:

$ sed -e 's/.*/&\n"&"\n[&]/' infile > outfile

It's also possible to read line-by-line in a shell script without messing with IFS:

  while read -r; do
    echo "$REPLY"
    echo "\"$REPLY\""
    echo "[$REPLY]"
  done < infile > outfile

This seems to strip leading and trailing spaces, depending on the shell.

--
"A story, I decided, is anything that keeps     http://carey.geek.nz/
the people reading turning the pages, and
doesn't leave them feeling cheated at the
end.  Everything else was up for grabs." -- Neil Gaiman

Attachment: signature.asc
Description: OpenPGP digital signature



Reply via email to