bashから存在しないコマンドを実行した後、ubuntuでそのメッセージを受け取った場合、システムはおそらくcommand_not_found_handle関数を使用しています。あなたはそれを見ることができます/etc/bash.bashrc。
ささいなハッキングがオプションかもしれません:私はちょうどという名前のスクリプトを作成しましたcnfh:
#!/bin/bash
# if the command-not-found package is installed, use it
if [ -x /usr/lib/command-not-found -o -x /usr/share/command-not-found/command-not-found ]; then
        function command_not_found_handle {
                # check because c-n-f could've been removed in the meantime
                if [ -x /usr/lib/command-not-found ]; then
                   /usr/lib/command-not-found -- "$1"
                   return $?
                elif [ -x /usr/share/command-not-found/command-not-found ]; then
                   /usr/share/command-not-found/command-not-found -- "$1"
                   return $?
                else
                   printf "%s: command not found\n" "$1" >&2
                   return 127
                fi
        }
fi
"$@"
RET_VAL=$?
if [ $RET_VAL -eq 127 ]; then
  OUT=$(command_not_found_handle "$@" 2>&1)
  $(echo $OUT |sed -n 's/.*\(apt-get install .\+\)$/\1/p')
fi
次に、このスクリプトを使用してtdコマンドを実行します。
# ./cnfh td
Ubuntu 14.04.2 LTSを使用します。それがお役に立てば幸いです。