1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/bin/bash quote () { local quoted=${1//\'/\'\\\'\'}; printf "'%s'" "$quoted" } quote_args() { for arg in "$@"; do quote "$arg" printf ' ' done } echo "type mksource &>/dev/null && mksource; jh checksource $(quote_args "$@")"