Skip to content

Instantly share code, notes, and snippets.

@shitpoet
Created February 1, 2020 22:17
Show Gist options
  • Save shitpoet/83d16e173a3658bd33b6e2e33e48ed5c to your computer and use it in GitHub Desktop.
Save shitpoet/83d16e173a3658bd33b6e2e33e48ed5c to your computer and use it in GitHub Desktop.
execute cs script from stdin using cs-script (cscs)
#!/bin/bash
# echo "using System; class App { public static void Main() { Console.WriteLine(1 + 1); } }" | cscsi.sh
# cat hello.cs | cscsi.sh
tmpfile=$(mktemp -p /dev/shm XXXXXXXXXXXXX.cs)
trap "rm -f '$tmpfile'" exit int term
cat > $tmpfile
cscs -ac $tmpfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment