If and Decision making is done

This commit is contained in:
Hizenberg469
2024-11-29 13:25:36 +05:30
parent 5759f3f807
commit 1ede16f3c4
4 changed files with 225 additions and 1 deletions

12
secret.sh Normal file
View File

@@ -0,0 +1,12 @@
#!/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