Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Logical-operations/UNIX-Shell/logical-operations-1.sh
Normal file
13
Task/Logical-operations/UNIX-Shell/logical-operations-1.sh
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
function boolVal {
|
||||
if (( ! $? )); then
|
||||
echo true
|
||||
else
|
||||
echo false
|
||||
fi
|
||||
}
|
||||
|
||||
a=true
|
||||
b=false
|
||||
printf '%s and %s = %s\n' "$a" "$b" "$("$a" && "$b"; boolVal)"
|
||||
printf '%s or %s = %s\n' "$a" "$b" "$("$a" || "$b"; boolVal)"
|
||||
printf 'not %s = %s\n' "$a" "$(! "$a"; boolVal)"
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
a=1
|
||||
b=0
|
||||
printf '%d and %d = %d\n' "$a" "$b" "$(( a && b ))"
|
||||
printf '%d or %d = %d\n' "$a" "$b" "$(( a || b ))"
|
||||
printf 'not %d = %d\n' "$a" "$(( ! a ))"
|
||||
Loading…
Add table
Add a link
Reference in a new issue