Files
cronmaster/app/_utils/snippets/while-loop-read.sh
2025-08-18 13:15:13 +01:00

15 lines
424 B
Bash

# @id: while-loop-read
# @title: While loop reading input
# @description: Read input line by line and process it
# @category: Loops
# @tags: loop,while,read,input
# Read input line by line
# You can pipe input: echo "line1\nline2" | ./script.sh
while IFS= read -r line; do
echo "Processing line: $line"
# Add your processing logic here
# Example: process_line "$line"
done
echo "Finished processing all input"