9 lines
161 B
Plaintext
9 lines
161 B
Plaintext
|
#!/bin/bash
|
||
|
while read IN
|
||
|
do
|
||
|
[[ ! $IN =~ ^[+-]?[0-9]+$ ]] && IN=0
|
||
|
[[ $IN -gt 100 ]] && IN=100
|
||
|
[[ $IN -lt 0 ]] && IN=0
|
||
|
echo $IN
|
||
|
done < "${1:-/dev/stdin}"
|