Hi.
Using sed:
Code:
$ sed 's/^/./' infile
(use -i flag to actually change infile or redirect to another file)
or in bash
Code:
while read line; do echo ".$line" ; done < infile
or using awk (mawk is faster)
Code:
mawk '{print "."$0}' infile
or perl
Code:
perl -ne 'print ".$_"' infile
(again, add -i to edit infile in place)
If you already have each line of a file in a variable, you can use something like this
Code:
$ x=123; echo ${x/#/.}
.123