This is just a review on `bash_lib`... # Returns the doceded url of given site. ex: http%3A%2F%2Fwww -> http://www # @param $1 the url # @param $2 the number of times to decode it. default: 2 I'm curious as to why you need to specify the number of times (attempts?) to decode such values... Also, do you have access to `perl`? Because if you do then it's *easier and shorter* to do via a simple Perl script. ;) To check for `yes` (or equivalent) inputs, I think a better approach is to normalize the casing first, then apply the `egrep`: <!-- language: lang-none --> $ for i in y Y Yes YES no; do tr '[[:upper:]]' '[[:lower:]]' <<< $i | egrep '^y(es|)$' -q \ && echo $i - OK; done y - OK Y - OK Yes - OK YES - OK Compare that with your current method: <!-- language: lang-none --> $ for i in y Y Yes YES no; do egrep '^([yY]|[Yy]es)$' -q <<< $i && echo $i - OK; done y - OK Y - OK Yes - OK For your `log()` function, you can use `date` to format the output directly: date +"[%c]: $1" # this echo "[$( date )]: $1" # instead of this <!-- --> ([[ $code -eq 1 ]] || [[ $code -eq 2 ]] || ([[ $code -ge 127 ]] && [[ $code -le 165 ]]) || [ $code = 255 ]) That can be simplified too, by putting them all within one `[[ ... ]]`: $ for code in 1 2 120 127 160 165 240 255; do if ([[ $code -eq 1 ]] || [[ $code -eq 2 ]] || ([[ $code -ge 127 ]] && [[ $code -le 165 ]]) || [ $code = 255 ]); then echo $code - Y1; fi; [[ $code -eq 1 || $code -eq 2 || ($code -ge 127 && $code -le 165) || $code -eq 255 ]] \ && echo $code - Y2; done 1 - Y1 1 - Y2 2 - Y1 2 - Y2 127 - Y1 127 - Y2 160 - Y1 160 - Y2 165 - Y1 165 - Y2 255 - Y1 255 - Y2 A step further is to combine it with `! [ "${_FORCED_EXIT}" = true ]`, I'll leave that as an exercise for the reader. Finally, a small nitpick: `wether` is spelled wrongly... it should be `whether`.