Answer the question
In order to leave comments, you need to log in
Reading from sh file?
I execute the following in the terminal:
for n in $*
do
count=` expr $count + 1`
done
I write the same thing to the sh-file, but the code is not read from the file, writes "syntax error next to the unexpected marker "$'do\ r'""
As far as I understand, before do there should not be a new line, but something else.
I suspect that the question is stupid, but I master it all in a hurry before the test, and there is no time to carefully google
Answer the question
In order to leave comments, you need to log in
In unix, a line feed is denoted by the symbol line feed (lf, \n, 0x0a, 10).
In windows - by the sequence carriage return + line feed (crlf, \r\n, 0x0d0a, 13 10).
Bash doesn't recognize carriage return and prints an error message.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question