From 7bb3697b4ed55f8864649c49ac7b03465d3c8883 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Sun, 28 Jun 2015 21:36:00 +0000 Subject: [PATCH] mv: Improve message when moving two or more files to non-directory. The message text is from cp, which has had a nicer message for this since 2007 (PR bin/50656). As with cp, the exit status changes from 64 to 1. PR: 201083 MFC after: 1 week --- bin/mv/mv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mv/mv.c b/bin/mv/mv.c index a95b07a288b..c19f6a047f9 100644 --- a/bin/mv/mv.c +++ b/bin/mv/mv.c @@ -122,7 +122,7 @@ main(int argc, char *argv[]) */ if (stat(argv[argc - 1], &sb) || !S_ISDIR(sb.st_mode)) { if (argc > 2) - usage(); + errx(1, "%s is not a directory", argv[argc - 1]); exit(do_move(argv[0], argv[1])); }