Skip to content

Latest commit

 

History

History
27 lines (16 loc) · 478 Bytes

common-shell-error-fix.md

File metadata and controls

27 lines (16 loc) · 478 Bytes

Shell Errors Fix

line 1: $' :\r': command not found”?

You have Windows-style line endings.

The no-op command : is instead read as :<carriage return>, displayed as :\r or more fully as $':\r'.

Method 1

$ dos2unix scriptname

Method 2

$ vi scriptname
:%s/\r$//
:x

References

Why am I getting “line 1: $' :\r': command not found”?