sed command
i am trying to help a buch of guys edit files for gaming servers using questions user input then sed command but if they put a space into the sting it fails can any one help
echo "Please give server name " read name sed s/clan/$name/g server.cfg > cfg.cfg if they dont type spaces its fine as soon as say they type "clan server" the script fails is there a way of letting them use spaces as bit of a pain in the rear can only use one word or a long sentence with no spaces |
you need to enclose your sed command in quotes
Code:
sed "s/clan/$name/g" server.cfg > cfg.cfg |
thanks such a simple answer and work boy do i feel stupid lol
|
|
Quote:
Code:
VAR="a b c d" |
ok thanks do you also know how i can soft or hard link folders so i can have say one folder with main game files in and another with the links in to the folder plus the server.cfg file for there individual server
i know im asking alot but hey i'm learning fast thanks |
Quote:
Code:
NAME |
All times are GMT -5. The time now is 08:10 AM. |