Hello again,
I am using on Windows XP many tools that originally I used in Linux: cat, sed, awk, head, tail, ls, wget.., and others. I found all those programs in the package UnxUtils
I am using “sed” many times just because it’s so useful for scripting.
However I have a problem: I don’t know how to add a suffix to lines using sed.
the following script:
cat file.txt | sed -e “s/$/suffix/”
will add the suffix AFTER each line so the result will look like:
line1
suffix
line2
suffix
…
I found a partial solution: cat file.txt | sed -e “s/.$/suffix/” – it will add the suffix to the lines but will “eat” the last character from each line. That”s ok just as long as all the lines end in the same character (for example with a space)
thanks
by the way, you should really use those from GNU (see my sig), not those from UnxUtils..(they are outdated)
GNU win32 packages | Gawk