Topic

user-input

4 articles

Bash

yesno() in Bash: Ask a Yes/No Question Safely

A yes/no confirmation prompt for Bash scripts that accepts any case, has an optional default and handles cron, pipes and EOF without looping forever.

6 min read, updated 17 Oct 2026

Bash

is_num() in Bash: Check if a Value Is a Number

Check that input is a whole number, a signed integer or a decimal before doing arithmetic, and avoid the octal, empty-string and injection problems in (( )).

6 min read, updated 17 Oct 2026