In cygwin, the following code works fine
$ cat junk bat bat bat $ cat junk | sort -k1,1 |tr \'b\' \'z\' > junk $ cat junk zat zat zat
You want to edit that file, you can just use the editor.
ex junk << EOF %!(sort -k1,1 |tr 'b' 'z') x EOF