Results for “Async work & status”
Small, practical examples. Search by task or narrow things down below.
Check exact array membership
Bash Scripts: Compare each element literally instead of searching a concatenated string.
Bash Scripts✓ Tested
Check for an installed command
Bash Scripts: command -v checks command resolution without assuming a specific installation path.
Bash Scripts✓ Tested
Check that a file is present and nonempty
Test file content availability before reading it.
file check✓ Tested
Check whether a file is already sorted
Linux Commands: Use sort -C for a quiet status check that does not rewrite the file.
Linux Commands✓ Tested
Check whether a floating-point value is finite
Check whether a floating-point value is finite in a complete Rust program using the standard library.
Rust✓ Tested
Check whether a function has been defined
Bash Scripts: declare -F tests a function name without executing it.
Bash Scripts✓ Tested
Check whether a variable exists under nounset
Bash Scripts: The plus expansion distinguishes an unset variable without reading its missing value.
Bash Scripts✓ Tested
Check whether bytes contain valid JSON
Check whether bytes contain valid JSON using a complete Go program with explicit sample inputs.
Go✓ Tested
Check whether input is a nonnegative integer
Reject empty input and nonnumeric characters before arithmetic.
validation✓ Tested
Choose a branch with if and else
Choose a branch with if and else using a complete Go program with explicit sample inputs.
Go✓ Tested
Choose among several numeric ranges
Bash Scripts: An if-elif chain evaluates branches in order and executes the first match.
Bash Scripts✓ Tested
Choose an action with case
Bash Scripts: Choose an action with case with a small standalone Bash program.
Bash Scripts✓ Tested