Just useHello,
I am searching for pkg or port dos2unix, but it does not exists
Is it not maintained anymore?Bash:# whereis dos2unix dos2unix: # whereis unix2dos unix2dos: /usr/ports/converters/unix2dos
tr
The port "installs" dos2unix
[ports] Contents of /head/converters/unix2dos/Makefile
svnweb.freebsd.org
tr -d '\r'
will do that.tr -d '\r' < input.txt > output.txt
iconv -f cp437 -t utf8
will do that.iconv -f cp437 -t utf8 input.txt > output.txt
#!/bin/sh -
cat -- "$@" | tr -d '\r' | iconv -f cp437 -t utf8
I’m paranoid, so I try to avoid any tools that replace in-place. I prefer to run the conversion, then check that the outcome is what I expect, then remove the original file (or mv(1) the new file over the original file). But that’s just me …
inplace iconv ... file.txt
, for example.Please append that to the thread Useful Scripts, and/or even better, file a bug report + patch to /usr/share/examples/csh/dot.cshrc (& tcsh/complete.tcsh and/or similar for other shells (e.g. shells/bash-completion).PS: I do have a shell function called “inplace” that can be used with any program that doesn’t support modifications in-place itself. That function keeps a backup of the original file (with extension “.BAK”). So I can writeinplace iconv ... file.txt
, for example.