sandbox/grep_c/grep_c.sh
2025-12-08 11:14:21 +03:00

10 lines
205 B
Bash
Executable file

#!/usr/bin/env bash
set -e
timeout 10 bash -c '
until [ $(grep -c "pattern" file.txt) -gt 0 ]; do
echo "pattern not found, sleeping for 2 secs..."
sleep 2
done
'
echo "pattern found! Exiting"