OK, so I have this script which was recommended to me for use with
Virtual Hosts and the automation of adding them. I want to be able to
run "scriptname domain.com user" and use arg's $1 and $2 in the script
so that sed can search a template file I've specified and replace the
flagged text with $1 and $2. Here's the script:
#!/bin/sh
cat vhost-template | sed -e 's/_DOMAIN_/$1/g' -e \ 's/_USERNAME_/$2/g' >
vhosts/$1.conf
echo "Added new Virtual Host."
echo "Server Name:" $1", for user:" $2
So I want it to read vhost-template which contains the _DOMAIN_ and
_USERNAME_ flags, and replace these flags with the $1 and $2 inputs
(respectively), then output the file to $1.conf. The echo lines work
great, saying "Server Name: bleh.com, for user bleh" but the $1 and $2
specified in the "cat" line are not changed when the script is run. Do
I need to declare $1 and $2 as variables and then put the var names in
the cat line, or can you even do that with a shell script? Any help
would be GREATLY appreciated! =)
Thanks in advance...
Chris
--
Chris Blessing
[EMAIL PROTECTED]
http://webguy.dCaff.com
-------------------------------------
** "I have never let schooling **
** interfere with my education." **
** - Mark Twain **
-------------------------------------
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]