Hi Guys
I have another problem I'm trying to solve and hope that some one can help me here.
This is the scenario:
I have a file and I want to add a line on the 3rd line of the file using a bash script. but instead its adding the the bash variable $WEBSITE.
Below is the bash script I'm using.
I have tried a few different ways of doing this with sed but nothing works.
Please help.
I have another problem I'm trying to solve and hope that some one can help me here.
This is the scenario:
I have a file and I want to add a line on the 3rd line of the file using a bash script. but instead its adding the the bash variable $WEBSITE.
Below is the bash script I'm using.
Code:
#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11
echo "what is the website ?"
read WEBSITE
if grep -q $WEBSITE "/etc/squid3/acls/allowed-sites"
then
echo "$WEBSITE already exists"
else
echo "adding website $WEBSITE"
sed -ie '3i\$WEBSITE\' /etc/squid3/acls/allowed-sites
echo "restarting squid"
fi
Please help.
Moderator's Comments: | ||
|