Dos2unix Alternative July 2, 2021 If you create scripts in Windows, editors sometimes add a carriage return in addition to the line feed. You can use dos2unix to remove the extra characters. Or you can use sed. sed -i -e 's/\r$//' script.shsed -i -e 's/\r$//' script.sh