I'm starting to study Bash and while analyzing some code in Github, I came across the following excerpts to create a theme:
which rbenv &> /dev/null || return
$(node -v 2> /dev/null)
I'm starting to study Bash and while analyzing some code in Github, I came across the following excerpts to create a theme:
which rbenv &> /dev/null || return
$(node -v 2> /dev/null)
which rbenv &> /dev/null || return
$(node -v 2> /dev/null)
which
gets the path of rbenv
and redirects stdout and stderr for /dev/null
with &>
, or ||
returns execution of node -v
and redirects to < in> stderr , 2>
.
Where:
which
: Gets the path of a file. &
: Symbol used to specify a file descriptor , when there is no descriptor, redirect to stdout and stderr .