I would like to iterate over every line content in a file, any quick solution using sed.
it is assumed that the input file
abc def 123
Expected output:
abcabc defdef 123123
sed \(.*\) \1\1 ' infile
sed 'h;G;s/\n//' file.txt
This might work for you:
echo -e 'aaA\nbbB\nccC' | sed 's/.*/&&/' aaAaaA bbBbbB ccCccC
It's even easier if you use a variable \0 that contains the string that was matched:
\0
sed 's/.*/\0\0/'
try it
awk '{print $0$0}' temp.txt