#!/bin/bash function send() { command="$1" shift echo " $@" } function send_error() { if [ "$#" -gt 1 ]; then send error "$@" elif [ "$#" -eq 1 ]; then send error "$1" "$(tr -d '\n')" else send error 255 unknown fi return 1 }