brucezepplin brucezepplin - 7 months ago 17
Perl Question

bash insert space in last but one position of each line

using the

$
regex I can get last position of each line. but if I have the following:

12345
23456
34567


I need to add a space so it becomes

1234 5
2345 6
3456 7


Thanks!

Answer
$ sed 's/.$/ &/' file
1234 5
2345 6
3456 7