bash-com/write

14 lines
338 B
Plaintext
Raw Permalink Normal View History

#!/bin/bash
# (0) Get current ABS directory
ROOT=$(dirname `realpath $0`);
# (1) Check arguments
test $# -lt 2 && echo "ERR: Missing arguments (id, message)" && exit 1;
# (2) load configuration file
test -f /tmp/outbuf_$1 || ( echo "ERR: No such id" && exit 1 ) || exit 1;
# (3) Write content to file
echo -ne "$2" >> /tmp/outbuf_$1;