FG

"Syntax error near unexpected token '$'\r''" in shell script

Fresh3 days ago
Mar 15, 202637120 views
Confidence Score0%
0%

Problem

I am writing a script am I am getting an error on lines 2-3. The error is printed like this: The file is called . Could someone provide some guidance as to why this error is happening?

Error Output

./ex6.sh: line2: $'\r': command not found
./ex6.sh: line3: syntax error near unexpected token '$'\r''
./ex6.sh: line3: 'fund ()

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: "Syntax error near unexpected token '$'\r''" in shell script

Low Risk

Use or a proper text editor to convert all your line breaks from Windows to .

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment