Hi!
I wrote a script shell about changing IP of the httpd.conf from text file and saving a new httpd.conf file for all IPs in the text file. The code is below, Im using mremote on windows (RHEL Release 5.7), and getting this error:
./script1.sh: line 19: syntax error: unexpected end of file
Please help me about that error. Thanks!
(ps: line 19 is the last line in the code => done < "$filename" )
#!/bin/bash
DATE='date +%Y%m%d_%H:%M:%S'
NAME=httpd_ip_change
EXTENSION=conf
max=10
filename="$1"
while read -r line
for ((i=2; i<=$max; ++i ))
do
touch $NAME$i.$EXTENSION.$DATE
sed "s/<VirtualHost 10.11.92.81:80>/$line/g" ./httpd.conf > $NAME$i.$EXTENSION.$DATE
done < "$filename"