Click to See Complete Forum and Search --> : newguy -- small script


cjmxy
03-31-2002, 03:27 PM
So, I'm new at scripting. Can someone helped. I posted this at a Newsgroup and was given a bunch of crap for it. I can't figure out why its not working.

if [ "$2" = "client" ];
then
echo Installing Client Only, this may take a while...
g++ -lncurses -O -I include/ -o confClient src/client.c src/PracticalSocket.cpp
echo Done Installing Just the Client.
elif [ $2 = server ];
then
echo Installing Server Only, this may take a while...
g++ -O -I include/ -I src/ -o confServer src/server.c src/PracticalSocket.cpp src/srvfuncs.c
echo Done Installying just the Server.
else
echo Installing the Client and Server, this may take a while....
echo Installing client...
g++ -lncurses -O -I include/ -o confClient src/client.c src/PracticalSocket.cpp
echo Finished client, installing server...
g++ -O -I include/ -I src/ -o confServer src/server.c src/PracticalSocket.cpp src/srvfuncs.c
echo Finished server, enjoy...
fi

I simply want to be able to ./install server and have it only compile the server. If someone can tell me exactly what is wrong, I would greatly appreciate it. There is some word wrap happening in this window thats not in the actual file.

As I said earlier, I'm not familar with scripting, so if a small explanation was included, that would be even better.

Thanks.

Tom