jezen / is-thirteen

Check if a number is equal to 13.
5.66k stars 472 forks source link

Simplified bash version #409

Open simoniz0r opened 7 years ago

simoniz0r commented 7 years ago
#!/bin/bash

if [ "$1" = "13" ]; then
    echo "Input is 13!"
else
    echo "Input is not 13!"
fi
automated-response commented 7 years ago

Misses edge cases such as "thirteen" and "XIII" and crashes where $1 is not equal to 13. You probably want either [ $1 -eq 13 ] or [[ "$1" == "13" ]]