Advertisement
justin_hanekom

Bash echo if verbose function

Mar 16th, 2019
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.45 KB | None | 0 0
  1. ################################################################################
  2. # Function:     echo_if_verbose
  3. # Description:  Prints $@ if IS_VERBOSE is not empty
  4. # Arguments:    $@ :- Content to echo if ${IS_VERBOSE} is not empty
  5. # Requires:     ${IS_VERBOSE} set to a non-empty string if verbose is on
  6. # Outputs:      Prints $@ if ${IS_VERBOSE} is not empty
  7. function echo_if_verbose {
  8.     if [ -n "${IS_VERBOSE}" ]; then
  9.         echo "$@"
  10.     fi
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement