From owner-freebsd-current Mon Sep 29 03:16:22 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id DAA02450 for current-outgoing; Mon, 29 Sep 1997 03:16:22 -0700 (PDT) Received: from mail.cs.tu-berlin.de (root@mail.cs.tu-berlin.de [130.149.17.13]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id DAA02440 for ; Mon, 29 Sep 1997 03:16:16 -0700 (PDT) Received: from panke.panke.de (anonymous214.ppp.cs.tu-berlin.de [130.149.17.214]) by mail.cs.tu-berlin.de (8.8.6/8.8.7) with ESMTP id MAA28713 for ; Mon, 29 Sep 1997 12:13:25 +0200 (MET DST) Received: (from wosch@localhost) by panke.panke.de (8.8.5/8.6.12) id MAA01857; Mon, 29 Sep 1997 12:11:14 +0200 (MET DST) Date: Mon, 29 Sep 1997 12:11:14 +0200 (MET DST) Message-Id: <199709291011.MAA01857@panke.panke.de> From: Wolfram Schneider To: current@freebsd.org Subject: silent cp -i MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-freebsd-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk cp(1) is too silent if used with the option -i. It should print which input cp expect (y/n) and print a warning if the file was not overwritten. [current behavior] $ touch from to $ cp -i from to overwrite to? n [new] $ cp -i from to overwrite to? (y/n [n]) n not overwritten Index: utils.c =================================================================== RCS file: /usr/cvs/src/bin/cp/utils.c,v retrieving revision 1.13 diff -u -r1.13 utils.c --- utils.c 1997/02/22 14:01:34 1.13 +++ utils.c 1997/09/28 10:38:32 @@ -81,13 +81,16 @@ * modified by the umask.) */ if (!dne) { +#define YESNO "(y/n [n]) " if (iflag) { - (void)fprintf(stderr, "overwrite %s? ", to.p_path); + (void)fprintf(stderr, "overwrite %s? %s", + to.p_path, YESNO); checkch = ch = getchar(); while (ch != '\n' && ch != EOF) ch = getchar(); if (checkch != 'y' && checkch != 'Y') { (void)close(from_fd); + (void)printf("not overwritten\n"); return (0); } } -- Wolfram Schneider http://www.apfel.de/~wosch/