1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#!/bin/bash if [[ $# -ne 2 ]]; then echo "Usage: $0 project filename" exit 1 fi HOST="${NORNS:-norns.local}" BASE="code/" PROJECT="$1" FILE="$2" FILE="$BASE$PROJECT/$2" ESCAPED="$(sed 's/"/\\"/g' <<<"$FILE")" norns_shell "ws://$HOST:5555" <<EOF norns.script.load("$ESCAPED") EOF