Allignment of lines in a file

Hi All,

I am using the below scrit to insert lines in a file:

#!/bin/ksh
# To delete the last line if it contains the pattern Redirect permanent / Virgin Atlantic Airways - Popup
echo "Enter the URL that should point to the particular microsite"
read url
# To delete the last line if it contains the pattern Redirect permanent / Virgin Atlantic Airways - Popup
if [ -z "$value" ]; then
echo "You have not enterd the URL" ; exit 1
else
grep "Redirect permanent / http://www.virgin-atlantic.com" redirects.virgin-atlantic.com.conf > output1
if [ $? -eq 0 ] ; then
rm -r output1
sed '$d' redirects.virgin-atlantic.com.conf > temp
cp temp redirects.virgin-atlantic.com.conf
echo $url >> redirects.virgin-atlantic.com.conf ;
echo "Redirect permanent / http://www.virgin-atlantic.com" >> redirects.virgin-atlantic.com.conf ;
echo "Redirects Setup"
else
echo $url >> redirects.virgin-atlantic.com.conf ;
echo "Redirects Setup"
fi
fi

I am getting the below output where the 2,3,4 line are in the same line whereas 5 and 6 are the lines that are inserted by using the script. Please can somebody advise how can I insert the 5 and 6 line so that they are alligned with the above lines.

              Redirect permanent /threadneedle [Virgin Atlantic Airways - Popup](http://www.virgin-atlantic.com/)
              Redirect permanent /THREADNEEDLE [Virgin Atlantic Airways - Popup](http://www.virgin-atlantic.com)
              Redirect permanent /vhipprize http://ad.uk.doubleclick.net
              Redirect permanent /lovefromabove http://www.virgin-atlantic.comp

Redirect permanent /shazin Virgin Atlantic Airways - Popup
Redirect permanent /shaz Virgin Atlantic Airways - Popup

Best Regards,
Shazin

---------- Post updated at 09:08 PM ---------- Previous update was at 09:05 PM ----------

Hio All,

Its not coming as required please can somebody suggest so that i can upload a txt file describing the output.

Thanks
Shazin

from where $value came into picture???

Without going into details of your script (needs lot of fixes):
Just quote all your echo statements with " " :

echo "$url"

If there are multiple spaces this will help.

Also, if you are unable to attach file then use the CODE option just like what you did for your script. And choose font as "Courier New". That should take care of the "alliginment".

Like this:

 
Redirect permanent /threadneedle  Virgin Atlantic Airways - Popup
Redirect permanent /THREADNEEDLE  Virgin Atlantic Airways - Popup
Redirect permanent /vhipprize     http://ad.uk.doubleclick.net
Redirect permanent /lovefromabove http://www.virgin-atlantic.comp
Redirect permanent /shazin        Virgin Atlantic Airways - Popup
Redirect permanent /shaz          Virgin Atlantic Airways - Popup

Also, I think this line needs a fix?

if [ -z "$value" ]; then
if [ -z "$url" ]; then