def shellscript?(filename)
      return false unless File.exist?(filename) && File.readable?(filename) \
        && File.file?(File.realpath(filename))

      shellscript_shebang?(filename) || \
        (shellscript_extension?(filename) && shellscript_syntax?(filename))
    end
def shellscript?(filename)
      return false unless File.exist?(filename) && File.readable?(filename) \
        && File.file?(File.realpath(filename))

      shellscript_shebang?(filename) || \
        (shellscript_extension?(filename) && shellscript_syntax?(filename))
    end
Create an object that can be used for inferring whether a file is or is
 not a shell script.
 @param [String] bash_path path to a Bash interpreter
 Checks whether the provided file refers to a shell script by
 determining whether the first line is a shebang that refers to a shell
 executable, or whether the file has a shellscript extension and contains
 valid shell syntax.
 @param [String,Pathname] filename the name of the file to be checked
 @return [Boolean] whether +filename+ refers to a shell script
 @note returns +false+ when +filename+ is not readable, even if +filename+
   indeed refers to a shell script.