Shell Scripts Matter

Thiht on March 12, 2017

The shell is an odd beast. Although it goes against every current trend in software engineering (strong typing, compile ... [Read Full]
This is a single comment view full discussion

i don't always use the trap builtin command, but i will start using it in my script. You should have made provision for type checking using the type builtin command.

for example to check if a command is a function or an alias

    s() {
       printf "bash is good\n"

    checkType=$(type -t s)

   [[ "$s" != "function" ]] && {
      printf "$s is not a function"
      exit 1 
code of conduct - report abuse