Created
April 30, 2013 17:47
-
-
Save diego898/5490461 to your computer and use it in GitHub Desktop.
An intermediary shell script I have to use to get cywgin and strawberry perl to play nicely together on windows. This script was taken from here: http://www.cs.unc.edu/~jeffay/dirt/FAQ/cygwin-perl.html
This file contains 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 | |
# This is necessary to make perl work with cygwin. Cygwin passes | |
# "cygwin style" paths to the program in the #! statement and ActiveState | |
# perl does not know what /cygwin/d/... means. | |
# So, we put #!/usr/local/bin/perl in the perl script and this is called | |
# This routine translates the path name to something of type d:/ | |
args="" | |
while [ $# -gt 0 ] | |
do | |
var=$1 | |
shift | |
if test "`echo $var | grep '/'`" = "$var" | |
then | |
# cygpath does the /cygwin/d/ to d:/ conversion | |
var=`cygpath -w $var` | |
# but then we have to swap \ for / (extra \ needed because the | |
# shell makes a first pass at removing the \. | |
var=`echo "$var" | sed 's/\\\/\\//g'` | |
fi | |
args="$args $var" | |
done | |
# finally the command is to call perl with the name of the script and the args. | |
cmd="c:/strawberry/perl/bin/perl.exe $args" | |
$cmd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment