Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aien-protocols-mv/blob/main/specs/osh-platform/tools/make-vectors.sh # aien-protocols-mv Canonical specifications, wire protocols, and schemas for the AIEN sovereign ecosystem Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aien-protocols-mv / specs / osh-platform / tools / make-vectors.sh` 33 lines ยท 1286 bytes Raw Blame History 1 #!/bin/bash 2 # make-vectors.sh: regenerate the OSH conformance inputs (vNNN.in, vNNN.env). 3 # Format: ../vectors/README.md. expected.txt is committed by hand and is NOT 4 # written here. Shell only: no Python, coreutils only. 5 # Usage: make-vectors.sh OUT_DIR (normally specs/osh-platform/vectors) 6 set -eu 7 export LC_ALL=C 8 OUT=${1:?OUT_DIR} 9 mkdir -p "$OUT" 10 rm -f "$OUT"/v*.in "$OUT"/v*.env 11 mkin() { printf '%b' "$2" > "$OUT/$1.in"; } 12 mkenv() { printf '%b' "$2" > "$OUT/$1.env"; } 13 mkin v001 'ls -l /tmp\n' 14 mkin v002 'a && b || c; d | e\n' 15 mkin v003 'echo $? $# "$@"\n'; mkenv v003 '@status=3\n@arg1=x\n@arg2=y z\n' 16 mkin v004 'x=1 y="2 3"\n' 17 mkin v005 'echo "a${B}c" $1\n'; mkenv v005 'B=Q\n@arg1=hello\n' 18 mkin v006 'ls nofile >o 2>&1\n' 19 mkin v007 'echo *.c\n' 20 mkin v008 'echo $(x)\n' 21 mkin v009 'echo "unterminated\n' 22 mkin v010 'a & b\n' 23 mkin v011 'echo $X "$X" '"''"'\n'; mkenv v011 'X= a b \n' 24 mkin v012 'echo $G\n'; mkenv v012 'G=*.c\n' 25 mkin v013 'echo a\0b\n' 26 mkin v014 'echo a\\\nb\n' 27 { printf 'echo '; head -c 1100 /dev/zero | tr '\0' a; printf '\n'; } > "$OUT/v015.in" 28 # v016 to v020: refusals numbered during implementation (omega#336), section 5.3 29 mkin v016 'echo {a,b}\n' 30 mkin v017 'echo {1..3}\n' 31 mkin v018 'echo ${10}\n' 32 mkin v019 '{ echo hi; }\n' 33 mkin v020 'echo {a} { } {}\n'