QNX extensions to cp

bridged with qdn.public.qnxrtp.applications
Post Reply
Bill Caroselli

QNX extensions to cp

Post by Bill Caroselli » Fri Oct 31, 2003 10:03 pm

In QNX4 the 'cp' command supported some extensions.
The one I'm most interested in is the option '-!P<pattern>'.

Is there anyway to duplicate the cp -!Ppattern option in QNX6?

E.G.
# don't copy *.bak files
cp -!p*.bak this_dir/* that_dir

Rennie Allen

Re: QNX extensions to cp

Post by Rennie Allen » Sat Nov 01, 2003 8:48 am

Bill Caroselli wrote:
In QNX4 the 'cp' command supported some extensions.
The one I'm most interested in is the option '-!P<pattern>'.

Is there anyway to duplicate the cp -!Ppattern option in QNX6?

E.G.
# don't copy *.bak files
cp -!p*.bak this_dir/* that_dir
I use find. For example:

# cp `find /this_dir -type f !-name "*.bak"` that_dir

Wordier, but ultimately far more powerful and portable.

Robert Rutherford

Re: QNX extensions to cp

Post by Robert Rutherford » Sun Nov 02, 2003 11:46 pm

On Sat, 01 Nov 2003 08:48:24 +0000, Rennie Allen wrote:
Bill Caroselli wrote:
In QNX4 the 'cp' command supported some extensions.
The one I'm most interested in is the option '-!P<pattern>'.

Is there anyway to duplicate the cp -!Ppattern option in QNX6?

E.G.
# don't copy *.bak files
cp -!p*.bak this_dir/* that_dir

I use find. For example:

# cp `find /this_dir -type f !-name "*.bak"` that_dir

Wordier, but ultimately far more powerful and portable.
I have switched to

# find [stuff] | pax -rw [destination_dir]

It has a few benefits:
- it doesn't suffer from command-line length limitations
- you can use the -s option to pax to modify paths/filenames on the fly

Rob Rutherford

Eric Johnson

Re: QNX extensions to cp

Post by Eric Johnson » Mon Nov 03, 2003 6:56 pm

Oddly enough, that is exactly what we suggested in the QNX 4 manuals, which
in versions 4.23 and later listed these cp options as deprecated. Those cp
options had roots in the old QNX 2 'backup' utility, whose functionality was
largely put into QNX 4's cp. As soon as we had a clean break (i.e. moving to
QNX Neutrino), I ditched them since the same functionality is available in a
portable manner by using find | pax -rw. Sometimes less is more, and this is
one of those times: cp still suffers from a long and tortured history of
roots in some of the capabilities of QNX 2 utilities, meandering with
changing POSIX draft specifications in the late 80's, being later ported to
Neutrino, etc. Hopefully no innocent ears will hear in your question a plea
for more functionality to be put into cp; it might dissuade them from
rewriting it, and we wouldn't want that to happen. :-) [off soapbox]

(http://www.qnx.com/developer/docs/qnx_4 ... /c/cp.html)


"Robert Rutherford" <ruzz@NoSpamPlease.ruzz.com> wrote in message
news:mord2h4yggis$.tfiv7so57aaz$.dlg@40tude.net...
On Sat, 01 Nov 2003 08:48:24 +0000, Rennie Allen wrote:

Bill Caroselli wrote:
In QNX4 the 'cp' command supported some extensions.
The one I'm most interested in is the option '-!P<pattern>'.

Is there anyway to duplicate the cp -!Ppattern option in QNX6?

E.G.
# don't copy *.bak files
cp -!p*.bak this_dir/* that_dir

I use find. For example:

# cp `find /this_dir -type f !-name "*.bak"` that_dir

Wordier, but ultimately far more powerful and portable.

I have switched to

# find [stuff] | pax -rw [destination_dir]

It has a few benefits:
- it doesn't suffer from command-line length limitations
- you can use the -s option to pax to modify paths/filenames on the fly

Rob Rutherford

Post Reply

Return to “qdn.public.qnxrtp.applications”