xrsh-buildroot/buildroot-v86/board/v86/rootfs_overlay/root/bin/a-text

8 lines
270 B
Bash
Executable File

#!/bin/sh
test -n "$1" || { echo "usage: a-text <textfile_or_string>"; exit; }
str="$1"
test -f "$str" && str="$(cat "$1" | sed ':a;N;$!ba;s/\n/\\n/g' )" # escape linebreaks
echo "<a-text value='${str}' position='-0.4 1.8 -3' grabbable></a-text>" >> /root/index.html