bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wish: cp: output some sort of message if copying was interrupted


From: Philip Rowlands
Subject: Re: wish: cp: output some sort of message if copying was interrupted
Date: Mon, 1 Jun 2009 17:08:57 +0100 (BST)
User-agent: Alpine 1.10 (DEB 962 2008-03-14)

On Sun, 24 May 2009, Elmar Stellnberger wrote:

 If I issue a 'cp -a' on one konsole and a 'killall -s SIGINT cp' on
another konsole cp -a will terminate just as if it had finished copying.

Not quite; the exit status passed to the calling process will show the signal used to terminate cp. This can in turn be used to diagnose a display any desired message, for example in bash:

$ PROMPT_COMMAND='[ $? -ne 0 ] && echo Command exited abnormally'
$ true
$ false
Command exited abnormally

Alternatively it would be possible to construct a signal-aware wrapper around cp and other interactive processes.

My regard would be to let it print something like 'copying interrupted'
(... and may be continued by issuing the same command once more).

As the tools already exist to build this feature it's not a good fit for adding to cp. The specific message regarding resumed copies would be highly dependent on the arguments to cp.


Cheers,
Phil




reply via email to

[Prev in Thread] Current Thread [Next in Thread]