In a Bash script, I'd like to define a boolean variable y
to store the negated value of another boolean variable x
. The following script,
#!/bin/bash
x=true
y=$(( ! "${x}" ))
echo "${y}"
sets variable y
to 1. How can I change y
so it evaluates to false
instead?