Sha256: 79656c00cdce90adefb1332ad21e38133678f8bab00b2e47f799a79f3903aceb
Contents?: true
Size: 609 Bytes
Versions: 240
Compression:
Stored size: 609 Bytes
Contents
#!/bin/bash # Get what Bob says. # %b interprets escapted characters (like '\n' for newline) input="$(printf %b "${1}")" # Remove space characters input="${input//[[:space:]]/}" # Is there silence? if [[ "${input}" == "" ]]; then echo "Fine. Be that way!" exit 0 fi # Is there shouting (capital letter and no lowercase letters) if [[ "$input" == *[[:upper:]]* ]] && [[ "$input" != *[[:lower:]]* ]]; then echo "Whoa, chill out!" exit 0 fi # Is it a question? (last character is a '?') if [[ "${input: -1}" == "?" ]]; then echo "Sure." exit 0 fi # Is it a regular statement ? echo "Whatever."
Version data entries
240 entries across 240 versions & 1 rubygems