diff --git a/bin/mv/mv.c b/bin/mv/mv.c index d33b28d5b7e5..5147a2db660b 100644 --- a/bin/mv/mv.c +++ b/bin/mv/mv.c @@ -199,7 +199,7 @@ do_move(const char *from, const char *to) } else if (iflg) { (void)fprintf(stderr, "overwrite %s? %s", to, YESNO); ask = 1; - } else if (access(to, W_OK) && !stat(to, &sb)) { + } else if (access(to, W_OK) && !stat(to, &sb) && isatty(STDIN_FILENO)) { strmode(sb.st_mode, modep); (void)fprintf(stderr, "override %s%s%s/%s for %s? %s", modep + 1, modep[9] == ' ' ? "" : " ",