Phill Coxon wrote:
Hey guys.

Can someone help me with a sed / bash script that takes an input file
and adds quotes and square brackets to the contents of each line,
outputting each variation to a new file?


i.e.:

Input file:

foo
bar
foo bar wizz bang

Output file:

foo
"foo"
[foo]
bar
"bar"
[bar]
foo bar wizz bang
"foo bar wizz bang"
[foo bar wizz bang"

Something like

sed -e 's/^.*$/\1\n"\1"\n[\1]\n/'
not tested....

Cheers, Rex

Reply via email to