#!/bin/sh # Verify how tmpfiles reads the argument, the last field of an entry set -eu TEST_DIR=$(dirname "$0") DIR=/tmp/arg CONF=/tmp/arg.conf test_teardown() { say "Running test teardown." run "rm -rf $DIR $CONF" } # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" run "cat > $CONF" < $CONF" < $CONF" </dev/null" | tr '\n' ' ')" = "$DIR/in " sep say 'w writes all of its argument to every path a glob matches' run "touch $DIR/w1 $DIR/w2" run "cat > $CONF" <<'CONF' w /tmp/arg/w? - - - - one\ntwo CONF run "/libexec/finit/tmpfiles --create $CONF" assert "First match" "$(texec cat $DIR/w1 | tr '\n' ' ')" = "one two" assert "Second match" "$(texec cat $DIR/w2 | tr '\n' ' ')" = "one two"