• Bad defaults for Unix 'cp" commands (Was: How can I rename and "touch"

    From Kenny McCormack@21:1/5 to usenet@f.winkler-ka.de on Fri Jul 21 10:54:16 2023
    In article <khv4chFlvvnU1@mid.individual.net>,
    Frank Winkler <usenet@f.winkler-ka.de> wrote:
    ...
    As many other people already said, that assumption is wrong. And to go
    one step further, IMO it rather sucks that UNIX "cp" _does_ update the >modification date unless using "-p". I never understood why it behaves
    this way as the content is untouched and why B should have a different
    time stamp than A after "cp A B". Even brain-dead systems don't do that.

    Yes, that's a long standing misfeature. It is one of those: They picked
    the wrong default in the beginning and every Unix "copy" program, from cp
    to rsync, et al, has had to do the wrong thing by default ever since. You
    need a command line option (-p or -a or something like that) in order to
    get the sensible behavior.

    Note that "mcp" does the right thing by default. That's the only
    exception to the above rule that I can think of.

    --
    I voted for Trump because I thought he'd make pussy grabbing legal.
    I honestly don't see any other way America could be made great again.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Elvidge@21:1/5 to Kenny McCormack on Fri Jul 21 13:00:26 2023
    On 21/07/2023 11:54, Kenny McCormack wrote:
    In article <khv4chFlvvnU1@mid.individual.net>,
    Frank Winkler <usenet@f.winkler-ka.de> wrote:
    ...
    As many other people already said, that assumption is wrong. And to go
    one step further, IMO it rather sucks that UNIX "cp" _does_ update the
    modification date unless using "-p". I never understood why it behaves
    this way as the content is untouched and why B should have a different
    time stamp than A after "cp A B". Even brain-dead systems don't do that.

    "cp A B" creates a new file 'B' so B has new modification time (unless overidden).

    "mv A B" should really be advertised as "rename A B" (unless A and B are
    on different filesystems).


    Yes, that's a long standing misfeature. It is one of those: They picked
    the wrong default in the beginning and every Unix "copy" program, from cp
    to rsync, et al, has had to do the wrong thing by default ever since. You need a command line option (-p or -a or something like that) in order to
    get the sensible behavior.

    Note that "mcp" does the right thing by default. That's the only
    exception to the above rule that I can think of.

    mcp : command not found - slackware and lmde5


    --

    Chris Elvidge, England
    I AM NOT THE NEW DALAI LAMA

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Frank Winkler@21:1/5 to Chris Elvidge on Fri Jul 21 14:11:26 2023
    On 21.07.23 14:00, Chris Elvidge wrote:

    >"cp A B" creates a new file 'B' so B has new modification time (unless
    >overidden).

    Creation, not modification.

    >mcp : command not found - slackware and lmde5

    I also don't know that one, neither on Solaris nor macOS nor Linux nor
    whatever ;) ...

    Regards

    Frank

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kenny McCormack@21:1/5 to usenet@f.winkler-ka.de on Fri Jul 21 12:24:12 2023
    In article <khvaveFlvvnU2@mid.individual.net>,
    Frank Winkler <usenet@f.winkler-ka.de> wrote:
    On 21.07.23 14:00, Chris Elvidge wrote:

    "cp A B" creates a new file 'B' so B has new modification time (unless
    overidden).

    Creation, not modification.

    Yes. Everybody knows that. The point is: It is a historical misfeature.

    mcp : command not found - slackware and lmde5

    I also don't know that one, neither on Solaris nor macOS nor Linux nor >whatever ;) ...

    Have neither you nor Chris heard of these wonderful pieces of software
    called "package managers"? They're really cool, and you should look into
    them. They are so cool - you just run them and they install new software
    on your system that you didn't have before. What's even better is that
    these package manager thingies *are* usually installed by default on your
    Linux system(s), you don't even have to explicitly get and install them.
    They just work. It is soooooooo kewl!

    --
    This is the GOP's problem. When you're at the beginning of the year
    and you've got nine Democrats running for the nomination, maybe one or
    two of them are Dennis Kucinich. When you have nine Republicans, seven
    or eight of them are Michelle Bachmann.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Elvidge@21:1/5 to Kenny McCormack on Fri Jul 21 14:27:58 2023
    On 21/07/2023 13:24, Kenny McCormack wrote:
    In article <khvaveFlvvnU2@mid.individual.net>,
    Frank Winkler <usenet@f.winkler-ka.de> wrote:
    On 21.07.23 14:00, Chris Elvidge wrote:

    >"cp A B" creates a new file 'B' so B has new modification time (unless
    >overidden).

    Creation, not modification.

    Yes. Everybody knows that. The point is: It is a historical misfeature.

    >mcp : command not found - slackware and lmde5

    I also don't know that one, neither on Solaris nor macOS nor Linux nor
    whatever ;) ...

    Have neither you nor Chris heard of these wonderful pieces of software
    called "package managers"? They're really cool, and you should look into them. They are so cool - you just run them and they install new software
    on your system that you didn't have before. What's even better is that
    these package manager thingies *are* usually installed by default on your Linux system(s), you don't even have to explicitly get and install them.
    They just work. It is soooooooo kewl!


    Slackpkg can't find it.
    Neither can "apt search" nor "apt list" on LMDE5.


    --

    Chris Elvidge, England
    I WILL NOT MESS WITH THE OPENING CREDITS

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Frank Winkler@21:1/5 to Kenny McCormack on Fri Jul 21 15:16:50 2023
    On 21.07.23 14:24, Kenny McCormack wrote:

    >Have neither you nor Chris heard of these wonderful pieces of software
    >called "package managers"? They're really cool, and you should look into

    Of course I have. But even with a package manager, I only install things
    that I know of. And just as an example, MacPorts also doesn't seem to
    know it:

    frank@lmka-2cl377md6r:~$ which mcp
    frank@lmka-2cl377md6r:~$ port search mcp
    Warning: port definitions are more than two weeks old, consider updating
    them by running 'port selfupdate'.
    mcpp @2.7.2_6 (devel)
    Alternative C/C++ preprocessor

    R-MCMCpack @1.6-3_1 (R, science, math)
    Markov Chain Monte Carlo (MCMC) package

    R-mcmcplots @0.4.3 (R, science)
    Functions for convenient plotting and viewing of MCMC output

    R-MCPAN @1.1-21 (R, science, math)
    Multiple contrast tests and simultaneous confidence intervals based on
    normal approximation

    R-ncvreg @3.14.1_1 (R, science, math)
    Regularization paths for SCAD and MCP penalized regression models

    wmcpuload @1.0.1_4 (sysutils, x11)
    An lcd dockapp that displays the current cpuload

    xdm @1.1.12 (x11)
    X11 display manager with support for XDMCP, host chooser

    xorg-libXdmcp @1.1.4 (x11, devel)
    X.org libXdmcp

    Found 8 ports.
    frank@lmka-2cl377md6r:~$

    I can try OpenCSW on a Solaris machine.

    Regards

    Frank

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kenny McCormack@21:1/5 to usenet@f.winkler-ka.de on Fri Jul 21 13:30:09 2023
    In article <khveq2FlvvnU3@mid.individual.net>,
    Frank Winkler <usenet@f.winkler-ka.de> wrote:
    On 21.07.23 14:24, Kenny McCormack wrote:

    Have neither you nor Chris heard of these wonderful pieces of software
    called "package managers"? They're really cool, and you should look into

    Of course I have. But even with a package manager, I only install things
    that I know of. And just as an example, MacPorts also doesn't seem to
    know it:

    There's also this really cool thing - called "google". You can find out
    all kinds of stuff using it. It's really amazing.

    Using this google thingie, you can learn about these things called "C compilers" and "make" programs. Then you can learn about doing things
    like:

    ./configure
    make

    --
    Q: How much do dead batteries cost?

    A: Nothing. They are free of charge.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kenny McCormack@21:1/5 to usenet@f.winkler-ka.de on Fri Jul 21 14:18:33 2023
    In article <khveq2FlvvnU3@mid.individual.net>,
    Frank Winkler <usenet@f.winkler-ka.de> wrote:
    On 21.07.23 14:24, Kenny McCormack wrote:

    Have neither you nor Chris heard of these wonderful pieces of software
    called "package managers"? They're really cool, and you should look into

    Of course I have. But even with a package manager, I only install things
    that I know of. And just as an example, MacPorts also doesn't seem to
    know it:

    BTW, just in case you're not just being deliberately obtuse, I put "mcp Linux" into a search engine and got (inter alia):

    https://www.unix.com/man-page/suse/1/mcp/

    HTH

    --
    Elect a clown, expect a circus.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ottavio Caruso@21:1/5 to All on Fri Jul 21 15:35:02 2023
    Am 21/07/2023 um 13:30 schrieb Kenny McCormack:
    There's also this really cool thing - called "google". You can find out
    all kinds of stuff using it. It's really amazing.

    Google is for softy-softy gen Z snowflake fembois.

    Real men use Gopher on BSD 4.2.

    --
    Ottavio Caruso

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David W. Hodgins@21:1/5 to Chris Elvidge on Fri Jul 21 10:28:30 2023
    On Fri, 21 Jul 2023 08:00:26 -0400, Chris Elvidge <chris@mshome.net> wrote:

    On 21/07/2023 11:54, Kenny McCormack wrote:
    In article <khv4chFlvvnU1@mid.individual.net>,
    Frank Winkler <usenet@f.winkler-ka.de> wrote:
    ...
    As many other people already said, that assumption is wrong. And to go
    one step further, IMO it rather sucks that UNIX "cp" _does_ update the
    modification date unless using "-p". I never understood why it behaves
    this way as the content is untouched and why B should have a different
    time stamp than A after "cp A B". Even brain-dead systems don't do that.

    "cp A B" creates a new file 'B' so B has new modification time (unless overidden).

    "mv A B" should really be advertised as "rename A B" (unless A and B are
    on different filesystems).

    From "man mv" ...
    NAME
    mv - move (rename) files

    Yes, that's a long standing misfeature. It is one of those: They picked
    the wrong default in the beginning and every Unix "copy" program, from cp
    to rsync, et al, has had to do the wrong thing by default ever since. You >> need a command line option (-p or -a or something like that) in order to
    get the sensible behavior.

    Note that "mcp" does the right thing by default. That's the only
    exception to the above rule that I can think of.

    mcp : command not found - slackware and lmde5

    The mcp command is from the package mmv ...
    URL : http://packages.qa.debian.org/m/mmv.html
    Summary : Move/copy/append/link multiple files

    Regards, Dave Hodgins

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Chris Elvidge on Sat Jul 22 06:25:38 2023
    On 2023-07-21, Chris Elvidge <chris@mshome.net> wrote:
    mcp : command not found - slackware and lmde5

    mcp seems to be something that was written by one

    Vladimir Lanin <lanin@csd2.nyu.***>

    in the year 1989 (or earlier).

    mcp is one of the links (or symlinks) to a single executable.

    It has four names: mmv, mcp, mad and mln, which implicitly specify a
    default action of -x, -c, -a or -l.

    It looks nice; why isn't it better known.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Chris Elvidge on Sat Jul 22 06:19:16 2023
    On 2023-07-21, Chris Elvidge <chris@mshome.net> wrote:
    On 21/07/2023 11:54, Kenny McCormack wrote:
    In article <khv4chFlvvnU1@mid.individual.net>,
    Frank Winkler <usenet@f.winkler-ka.de> wrote:
    ...
    As many other people already said, that assumption is wrong. And to go
    one step further, IMO it rather sucks that UNIX "cp" _does_ update the
    modification date unless using "-p". I never understood why it behaves
    this way as the content is untouched and why B should have a different
    time stamp than A after "cp A B". Even brain-dead systems don't do that.

    "cp A B" creates a new file 'B' so B has new modification time (unless overidden).

    "mv A B" should really be advertised as "rename A B" (unless A and B are
    on different filesystems).

    mv would have the semantics of a rename, if a filesystem was represented
    as a list of < path, object > pairs (which could be true of some
    filesystems).

    But in fact, due to the reality of the hierarchical directory structure
    of the typical filesystems we use, a move between directories is a
    relocation, because the object is put under a different parent.

    If mv could be called rename, that would open up another opportunity
    for a correction. Copying data is called moving, so cp could be renamed
    to mv, like it wants to be!

    That's consistent with "MOVE R3, R4" and memmove(dest, str, size).

    :)

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wayne@21:1/5 to Kaz Kylheku on Sat Jul 22 05:23:15 2023
    On 7/22/2023 2:25 AM, Kaz Kylheku wrote:
    On 2023-07-21, Chris Elvidge <chris@mshome.net> wrote:
    mcp : command not found - slackware and lmde5

    mcp seems to be something that was written by one

    Vladimir Lanin <lanin@csd2.nyu.***>

    in the year 1989 (or earlier).

    mcp is one of the links (or symlinks) to a single executable.

    It has four names: mmv, mcp, mad and mln, which implicitly specify a
    default action of -x, -c, -a or -l.

    It looks nice; why isn't it better known.


    IIRC, in System V, cp, mv, and ln were all links to a single executable.

    --
    Wayne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ottavio Caruso@21:1/5 to All on Sat Jul 22 10:57:42 2023
    Am 22/07/2023 um 09:23 schrieb Wayne:
    On 7/22/2023 2:25 AM, Kaz Kylheku wrote:
    On 2023-07-21, Chris Elvidge <chris@mshome.net> wrote:
    mcp : command not found - slackware and lmde5

    mcp seems to be something that was written by one

    Vladimir Lanin <lanin@csd2.nyu.***>

    in the year 1989 (or earlier).

    mcp is one of the links (or symlinks) to a single executable.

    It has four names: mmv, mcp, mad and mln, which implicitly specify a
    default action of -x, -c, -a or -l.

    It looks nice; why isn't it better known.


    IIRC, in System V, cp, mv, and ln were all links to a single executable.


    They still are on Busybox.


    --
    Ottavio Caruso

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)