#!/bin/sh if echo "$1" | grep -Eq "^/"; then path=$1 else path=`pwd`/$1 fi path=`echo "$path" | sed 's/ /%20/g'` #really should use recode or something equivalent to be more robust firefox "file://$path" #could call htmlview or equivalent here