#!/bin/sh # written by guido socher if [ -z "$1" ]; then cat > /tmp/nsfile.$$ firefox -remote "openURL(file:/tmp/nsfile.$$)" else if [ "$1" = "-h" ]; then echo "htmlview -- show a html file in an existing firefox browser" echo "USAGE: htmlview [-h] [file or url]" echo " " echo "htmlview reads stdin if no file name is provided." exit 0 fi if [ -r "$1" ]; then #check if abs path, we need abs path if (echo "$1" | egrep -s "^/") then file="$1" else pwd=`pwd` file="${pwd}/$1" fi firefox -remote "openURL(file:$file)" else firefox -remote "openURL($1)" fi fi