Skip to content

Instantly share code, notes, and snippets.

@callmekohei
Last active December 8, 2016 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save callmekohei/e98d3a998062a962944a0adacb002da0 to your computer and use it in GitHub Desktop.
Save callmekohei/e98d3a998062a962944a0adacb002da0 to your computer and use it in GitHub Desktop.
Fio is F# Interactive wrapper in Bash.
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