【发布时间】:2013-10-05 02:39:53
【问题描述】:
我创建了一个 shell,当我给 cp 命令提供错误数量的参数(例如参数不足)时,我会收到 Linux shell 错误消息,就像您输入 cp fork.c 时会收到的一样:
mysh> cp fork.c
cp: missing destination file operand after `fork.c'
Try `cp --help' for more information.
如何绕过此错误消息并打印我自己的错误消息,例如 Dude! this is an error ?
【问题讨论】:
-
消息不是来自内核..
标签: c linux error-handling arguments kernel