Shell binary search with sorted input
It's pretty cool to be able to do this in Bash.

Input validation

There are several issues here:


puppy=$1; [ -z "$puppy" ] &amp;&amp; {
    echo "@@@ No args specified."
    exit
}



Code is most readable when there is one statement per line,
so I suggest to separate the variable assignment and the input validation steps.

exit without arguments exits with the code of the last command,
in this case 0 because the echo most probably succeeds,
so the program exits with success.
But it shouldn't. A common practice is to use exit code 2 for invalid usage.

Lastly, instead of not-valid-and-exit I think valid-or-else-exit is a somewhat cleaner logic, and also simpler to write:

puppy=$1
[ "$puppy" ] || {
    echo "@@@ No args specified."
    exit 2
}


Unnecessary $size

The size variable is unnecessary.
You can use ${#swamp[*]} instead, for example in:

right=$((${#swamp[*]} - 1))


Unnecessary $ inside $((...))

You can simplify these:


mid=$((($left + $right) &gt;&gt; 1))
right=$(($mid - 1))



Like this:

mid=$(((left + right) &gt;&gt; 1))
right=$((mid - 1))