Sha256: 4ebbf985454e98fc573dc8f9650bc464e08eb08942ff39194e1ade67cfbf603c
Contents?: true
Size: 855 Bytes
Versions: 48
Compression:
Stored size: 855 Bytes
Contents
#!/bin/bash # # validators.sh # #------------------------------------------------------------------------------- # Validate a string. (Must be non empty.) # # USAGE:> validate_string $STR # function validate_string() { if [ ! "$1" ] then return 1 else return 0 fi } #------------------------------------------------------------------------------- # Validate an existing file. # # USAGE:> validate_file $FILE # function validate_file() { if [ ! "$1" ] || [ ! -f "$1" ] then return 1 else return 0 fi } #------------------------------------------------------------------------------- # Validate an existing directory. # # USAGE:> validate_directory $DIR # function validate_directory() { if [ ! "$1" ] || [ ! -d "$1" ] then return 1 else return 0 fi }
Version data entries
48 entries across 48 versions & 1 rubygems