shell programming Syntax Error unexpected word, `$ '\ r''
I am using cygwin for shell programming and this is my first program and i can't understand the error mentioned in the title at line 4 in for loop.here is the code
ski=0
wski=1
rwski=950435
for (( i = 1; i < 77; i++ ))
do
if [ $i -lt 45] ; then
dd if=3d.jpg ibs开发者_C百科=1024 count=1 skip=$ski of=myimage.dd obs=1024 seek=$wski conv=notrunc
expr $ski = $i
expr $wski = $wski + $i
else
expr $rwski = $rwski - $i
expr $ski = $i
dd if=3d.jpg ibs=1024 count=1 skip=$ski of=myimage.dd obs=1024 seek=$rwski conv=notrunc
fi
done
can someone please help me to correct this.
regards,
w
add a space after 45
, ]
is an argument for the function [
.
but your problem is probably mixed dos/unix line endings, fix it with a proper editor or use dos2unix
.
精彩评论