Код: Выделить всё
#!/bin/sh
PATCHES=(
3f98185fb8f88c181877e909ab1b6422fb9bca1e,
8fcac3b2bb8ce4cdbcffc126df779bf1be168882,
bda5a2ffb833b2824325bd9361b30dbaf5f78068,
c14e322a92a24e704836c5c12207c694a30e805f,
f86c46f6403fe338a544ab134bdf563c5b0934ae,
ffbe1ca986bd299e1fc894440849914378adbf5c
)
for i in "${PATCHES[@]}"
do{
# Check if patch file exists in directory
if [ -f $i ];
then
echo "$i file exists"
else
echo "$i file doesn't exist, downloading:"
curl "http://source.winehq.org/git/wine.git/patch/$i" -o $i
fi
# Apply patch if necessary
if nohup patch -p1 -N --dry-run --silent <$i 2>/dev/null; then
echo "$i Patching now:"
patch -p1 < $i
else
echo "$i Already applied"
fi
echo
}
done
выдает
root@xubuntu:~# ./222.sh
./222.sh: 3: ./222.sh: Syntax error: "(" unexpected