#!/bin/sh
for repo in repoA, repoB, repoC;
do
echo Cloning $repo.
done
When I execute this (sh myscript.sh) I get the following:
myscript.sh: line 2: syntax error near unexpected token `$'\r''
'yscript.sh: line 2: `for repo in repoA repoB repoC;
Ideas?
echo myscript.sh | od -cto peak at the characters. The commas are a problem, too. See cyberciti.biz/faq/bash-for-loop.\rwhich moved the cursor back to wheremwas and printed'thus the weird output. Try runningdos2unix myscript.sh. This should convert CRLF to\n.file myscript.shwill tell you what kind of file is myscript.sh.cat -veT myscript.shwill print the contents of myscript.sh including non-printable characters.