u6a/tests/u6a_run

17 lines
595 B
Bash
Executable File

#!/usr/bin/env bash
#
# 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.
#
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 -
# Usage: ./u6a_run u6ac_bin u6a_bin b64_encode_ops b64_decode_ops src_code [input_file]