Last active
December 8, 2016 16:31
-
-
Save callmekohei/e98d3a998062a962944a0adacb002da0 to your computer and use it in GitHub Desktop.
Fio is F# Interactive wrapper in Bash.
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
if [ -z "$1" ] ; then | |
echo '' | |
echo ' fio is FSharp In Out.' | |
echo '' | |
echo ' -e Eval script.' | |
echo ' -r Read script path.' | |
echo '' | |
exit | |
elif [ "$1" = "-e" ] && [ -z "$2" ] ; then | |
echo 'You need script or file path' | |
exit | |
elif [ "$1" = "-e" ] && [ -n "$2" ] ; then | |
str=$2' |> printfn "%A"' | |
mono ~/Documents/myBin/URLEncoder/urlencode.exe $str > /tmp/std.out.$$ 2>/tmp/std.err.$$ | |
std_out=`cat /tmp/std.out.$$` | |
std_err=`cat /tmp/std.err.$$` | |
rm -f /tmp/std.out.$$ | |
rm -f /tmp/std.err.$$ | |
curl -s -w '\n' 'localhost:8083/evalInteraction/'$std_out | |
elif [ "$1" = "-r" ] && [ -z "$2" ] ; then | |
echo 'You need script or file path' | |
exit | |
elif [ "$1" = "-r" ] && [ -n "$2" ] ; then | |
mono ~/Documents/myBin/URLEncoder/urlencode.exe $2 > /tmp/std.out.$$ 2>/tmp/std.err.$$ | |
std_out=`cat /tmp/std.out.$$` | |
std_err=`cat /tmp/std.err.$$` | |
rm -f /tmp/std.out.$$ | |
rm -f /tmp/std.err.$$ | |
curl -s -w '\n' 'localhost:8083/evalScript/'$std_out | |
else | |
echo 'You need -e or -r' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment