#!/bin/sh # Open a file with firefox # License: LGPLv2 # firefox 2 now supports this so this script it now redundant. if echo $1 | grep -Eq "^/" { global path := $1 } else { global path := "$[pwd]/$1" } global 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 (CommandList children: [ (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [(C {(echo)} {(DQ ($ VSub_Number "$1"))}) (C {(grep)} {(-Eq)} {(DQ ("^/"))})] negated: False ) terminator: ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:path) op: Equal rhs: {($ VSub_Number "$1")} spids: [38] ) ] spids: [38] ) ] spids: [-1 35] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:path) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(pwd)})]) left_token: spids: [45 47] ) (/) ($ VSub_Number "$1") } spids: [44] ) ] spids: [44] ) ] spids: [41 51] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:path) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {(DQ ($ VSub_Name "$path"))}) (C {(sed)} {(SQ <"s/ /%20/g">)}) ] negated: False ) ] ) left_token: spids: [55 69] ) } spids: [54] ) ] spids: [54] ) (C {(firefox)} {(DQ ("file://") ($ VSub_Name "$path"))}) ] )