Last active
January 15, 2016 01:39
-
-
Save cvmat/4442244 to your computer and use it in GitHub Desktop.
A script invoking Firefox on Cygwin.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# Confirm that the script is invoked from a Windows session, | |
# not a SSH session. | |
if [ -z "$SESSIONNAME" ] ; then | |
exit; | |
fi | |
alias firefox='/cygdrive/c/Program\ Files\ \(x86\)/Mozilla\ Firefox/firefox.exe' | |
if (echo $1 | egrep --silent "^file:///") then | |
# the file exists in the local machine | |
PATH_OF_LOCAL_FILE=`echo $1 | sed 's/file:\/\///'`; | |
URL=file:///`cygpath --mixed $PATH_OF_LOCAL_FILE ` | |
elif (echo $1 | egrep --silent "^file://[^/]") then | |
# the file exists in the remote machine on network | |
PATH_OF_REMOTE_FILE=`echo $1 | sed 's/file://'`; | |
URL=file:///`cygpath --mixed $PATH_OF_REMOTE_FILE ` | |
else | |
URL=$1 | |
fi | |
#firefox -remote 'OpenURL('$URL',new-tab)' | |
firefox -new-tab $URL & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Or perhaps just:
cygstart $URL