I need to check if $1 or $2 are empty before continuing but I don't know if bash has any logic of the sort. This is what I'm looking for - except that "and" doesn't seem to work.
if [ -n "$1" ] and [ -n "$2" ];then
...
Thank you!
I need to check if $1 or $2 are empty before continuing but I don't know if bash has any logic of the sort. This is what I'm looking for - except that "and" doesn't seem to work.
if [ -n "$1" ] and [ -n "$2" ];then
...
Thank you!
[ "$1$2" ]|| ...
I'm unable to get this to work. Could you use my example (with "if" and "then") to demonstrate this?
Thank you!
Slow...
he means
[ "$1"$2" ]] || echo "both zero length"
# or
if [[ "$1" == "" && "$2" == "" ]] ; then
echo "both zero length"
fi
Awesome! Thank you both!
Here's what I did:
if [[ -n "$1" && -n "$2" ]] ; then
echo "We're good"
else
echo "We're not good"
fi