Adding prefix to the values in the script

Hi,

test.txt contains below values

1
2
3
4
5

Desired output:

'TT.1',
'TT.2',
'TT.3',
'TT.4',
'TT.5'

Last value should not contain the comma after the value. Below is the script which i have tried. I'm using Linux.

#!/bin/bash
for i in $test.txt
do
x = 'TT.$i'
echo $x
done

Please help.

Many thanks in advance.

$ sed "s/.*/'TT.&',/;$ s/,//" test.txt
'TT.1',
'TT.2',
'TT.3',
'TT.4',
'TT.5'

To keep the forums high quality for all users, please take the time to format your posts correctly.

First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags

```text
 and 
```

by hand.)

Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.

Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.

Thank You.

The UNIX and Linux Forums

Thanks a lot scottn.

awk -v a="'" '{print a "TT." $0 a ","}' urfile