Files
Makefile-tutorial/secret.sh
2024-11-29 13:25:36 +05:30

12 lines
348 B
Bash

#!/bin/bash
echo -n Your age:
read AGE
#Problem with output as () cause to execute command in subshell.
#[ $AGE -lt 20 ] && (echo You are not allowed to see secret; exit 1) || echo Welcome
#command execute it same shell
[ $AGE -lt 20 ] && { echo You are not allowed to see secret; exit 1;} || echo Welcome
echo Secret is that there is no secret