#!/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