mirror of
https://github.com/Hizenberg469/Makefile-tutorial.git
synced 2026-04-19 22:02:24 +03:00
created shell dir
This commit is contained in:
12
shell/secret.sh
Normal file
12
shell/secret.sh
Normal 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
|
||||
Reference in New Issue
Block a user