Bash for loop error -
I am using a simple Bash script for loop, and I keep the following error: < Pre> Use the following code However, when I tried it on other machines. It does not make any problems. Is obtained. Please help. Your Seeing the shell ./ test.sh 2> & Amp; 1 | Cat-A To see what exactly is in the error message To fix your capacitance, filter your This is a common problem on signin. Have you used a Windows Editor to create scripts? '/ test.sh: line 2: Syntax error near the unexpected token' do '/test.sh: Line 2: `Do
Eating for dog in dog cat elephant "There are $ {animals}" ....
test.sh script has Windows-style line end in Shell Line At the end of each, the
\ r \ n sees the sequence as a
\ r character.
instead of \ r instead of
. Since
\ r sends the cursor to the beginning of the line, so try to see the quotation marks at the beginning of the line
test.sh script through something like
dos2unix . (Be sure to read the man page first;
dos2unix , unlike most text filters, overwrites its input file.)
Comments
Post a Comment