|
[root@myhost down]# bash file.sh-s
bash file.sh-s
file.sh-s: line 7: [0: command not found
file.sh-s: line 12: [0: command not found
file.sh-s: line 16: [0=2]: command not found
file.sh-s: line 7: [1: command not found
file.sh-s: line 12: [1: command not found
file.sh-s: line 16: [1=2]: command not found
file.sh-s: line 7: [2: command not found
file.sh-s: line 12: [2: command not found
file.sh-s: line 16: [2=2]: command not found
[root@myhost down]# cat file.sh-s
cat file.sh-s
#!/usr/bin/bash
a=(core community extra)
for i in 0 1 2
do
ls -l .>file.cmp
c=$i
if ["$c" = "0"]
then
cat file.cmp
#|sed -e 's/^/http:\/\/mirrors.lcuc.org.cn\/archlinux\/core\/os\/i686\//'>file.${a[$i]};
fi
if ["$c" = "1"]
then
cat file.cmp|sed -e 's/^/http:\/\/mirrors.lcuc.org.cn\/archlinux\/community\/os\/i686\//'>file.${a[$i]};
fi
if ["$c"="2"]
then
cat file.cmp|sed -e 's/^/http:\/\/mirrors.lcuc.org.cn\/archlinux\/extra\/os\/i686\//'>file.${a[$i]};
fi
done
exit 0 |
|