Sorry. The file seems a mess because the new lines was all moved. I try it again. If this not work i will send it atachement. Diego. #!/bin/sh # characters delimiting the fields for read IFS=" '/" # Read dillo's request read -d'>' tag cmd cmd_value url url_tag1 url_tag2 url_value_e # read put each field in a variable. them looks like: # tag "<dpi" # cmd "cmd=" it can be intersting to test this strings # cmd_value "open_url" for this aplication. Dillo can send "add_bookmark" and # "chat" too.(0.8.0 version) With a case we can respond to every dillo command # url "url=" for this command # url_tag1 "dpi:" for this app ... # url_tag2 "tidy" # url_value_e "http://server.com/path/file.html'" we do not want that final ' # so we delete it url_value=`echo -n "$url_value_e" | tr -d "'"` # get the name of the file name=`basename "$url_value"` # with the follow lines we get the url without the filename without using awk u_tmp1=` echo -n "$url_value" | tr "." "\n" ` u_tmp2=` echo -n "$u_tmp1" | tr "/" "." ` n_tmp=` echo -n "$name" | tr "." "\n" ` b_tmp1=` basename "$u_tmp2" ".$n_tmp" ` b_tmp2=` echo -n "$b_tmp1" | tr "." "/" ` base=` echo -n "$b_tmp2" | tr "\n" "." ` # we change status line with send_status_message PI to Dillo command echo "<dpi cmd='send_status_message' msg='tidy up $url_value. please wait'>" ## we send a wait page with the start_send_page command. We can command dillo ## to "reload_request" and "chat" too. (0.8.0 version) #cat <<EOF #<dpi cmd='start_send_page' url='dpi:/tidy/wait.html'> #Content-type: text/html # #<html> # <head> # <title> Wait a moment TYDY up this MESS </title> # </head> # <body> # <h1> # Tidy up this mess ($url_value) <br> # Please wait a moment # </h1> # </body> #</html> # # #EOF # we download the page url_value to /tmp with wget wget --no-parent -nc -nH --cut-dirs=30 -P /tmp/ $url_value # with this the page works in local like from inet. Tidy move base to the # right html place echo "<base href=$base >" >> /tmp/$name # we send the html header # Don't forget the empty line after the Content-type cat <<EOF <dpi cmd='start_send_page' url='$url_value'> Content-type: text/html EOF # and tidy do the rest tidy /tmp/$name # clean up the tmp files rm /tmp/$name