2005-12-03 17:40:54 matwix napisał:
> #!/bin/bash
> if [ \\"$1\\"=\\"start\\" ]; then
^^^^^^^^^^^^
powinno być \\"$1\\" = \\"start\\" (spacje przy
![smiley =)](http://forum.linux.pl/Smileys/default/smiley.gif)
> echo \\"Loading firewall rulez\\"
> elif [ \\"$1\\"=\\"stop\\" ]; then
^^^^^^^^^^^^^^^^^^^^^^^
nie ma poleceń jakie ma wykonać w razie, gdy $1 = stop
> elif [ \\"$1\\"=\\"status\\" ]; then
> echo \\"Firewall status\\"
> else echo \\"Please select start|stop|status\\"
> fi
Podpowiem, że do tego typu konstrukcji lepsze jest case, np.:
#!/bin/bash
case \\"$1\\" in
start)
echo \\"Start\\"
;;
stop)
echo \\"Stop\\"
;;
*)
echo \\"Usage: start | stop\\"
;;
esac
Pozdrawiam