I have a file with following content:
$ cat -n w
1 Smith John 12345 jsmith
2 Jones Robert 23456 rjones
3 Green Ralph 34567 rgreen
4 Brown Fred 45678 fbrown
5 Orange Mabel 56789 morang
I want to get each line and then append at the end of that line the same text of that line.
Example I want this output:
$ cat -n w
1 Smith John 12345 jsmith Smith John 12345 jsmith
2 Jones Robert 23456 rjones Jones Robert 23456 rjones
3 Green Ralph 34567 rgreen Green Ralph 34567 rgreen
4 Brown Fred 45678 fbrown Brown Fred 45678 fbrown
5 Orange Mabel 56789 morange Orange Mabel 56789 morange
I looked into sed command with backreferencing however I can't get it to work
$ sed 's/(.*)/\t\1/' wider
sed: -e expression #1, char 12: invalid reference \1 on `s' command's RHS
paste infile infile