Files
ewwii/examples/data-structures/scripts/readlast_and_truncate.sh
2025-08-17 12:28:53 +05:30

11 lines
240 B
Bash
Executable File

#!/bin/sh
while true; do
# read the last line
if [ -s /tmp/selected_emoji.txt ]; then
tail -n 1 /tmp/selected_emoji.txt
# truncate the file after reading
: > /tmp/selected_emoji.txt
fi
sleep 0.1
done