u6a/tests/u6a_run

17 lines
595 B
Plaintext
Raw Normal View History

2020-03-14 20:31:20 +00:00
#!/usr/bin/env bash
2020-10-10 19:31:31 +00:00
#
# Copyright (C) 2020 CismonX <admin@cismon.net>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty, provided the copyright notice and
# this notice are preserved. This file is offered as-is, without any warranty.
#
2020-03-14 20:31:20 +00:00
2020-06-22 05:57:09 +00:00
CMD=`[[ "$5" == "/"* ]] && echo 'cat' || echo 'echo'`
U6A_BYTECODE=`$CMD $5 | $1 - | base64 $3`
test -z $U6A_BYTECODE && exit -1
cat <(echo $U6A_BYTECODE | base64 $4) <(test $6 && cat $6) | $2 -
2020-03-14 20:31:20 +00:00
# Usage: ./u6a_run u6ac_bin u6a_bin b64_encode_ops b64_decode_ops src_code [input_file]