hachyderm.io is one of the many independent Mastodon servers you can use to participate in the fediverse.
Hachyderm is a safe space, LGBTQIA+ and BLM, primarily comprised of tech industry professionals world wide. Note that many non-user account types have restrictions - please see our About page.

Administered by:

Server stats:

9.7K
active users

@mcc

Update to (at least) coreutils 9.2, or use a distro which provides that.

With that version, mv -n will print an error and return 1 if a file is skipped. (Previously, it just printed nothing to indicate it was doing nothing. Insert Drake meme here.)

@mcc

There is a new `--update none` option to get the old noclobber behavior, if you want it.

tbh I'm surprised 1) they made what could be a breaking change and 2) to my knowledge there has been no "you broke my scripts" outcry. Although probably the second can be found if I look hard enough.

Also, apparently posix only specifies -i and -f. Because, sure.

@mcc

IMHO good for the coreutils maintainers for making some of this stuff make more sense after all of these years.

But I'll wait for the "they hate Unix!" crowd to show up.

@mattdm @mcc Unfortunately `-n` doesn't seem to be race-free though :/

unix.stackexchange.com/questio

With that in mind (if still true), I don't see any worth in a `-n` flag (invoking the "it's not UNIX" meme here :D). Then again, while there are many very bad options added by the GNU project if you ask me (GNU/tar's --checkpoint-action flag springs to mind), but this'd be a really useful flag in principle.

Unix & Linux Stack Exchangemv: Move file only if destination does not existCan I use mv file1 file2 in a way that it only moves file1 to file2 if file2 doesn't exist? I've tried yes n | mv -i file1 file2 (this lets mv ask if file2 should be overridden and automatically

@ljrk @mcc

Haven't tested, but I believe that's been fixed sometime after 2015. From the release notes for 8.30 (2018):

``` 'mv -n A B' no longer suffers from a race condition that can
overwrite a simultaneously-created B. This bug fix requires
platform support for the renameat2 or renameatx_np syscalls, found
in recent Linux and macOS kernels. As a side effect, 'mv -n A A'
now silently does nothing if A exists.
[bug introduced with coreutils-7.1]
```

@ljrk @mcc

Also this explains the `mv -n` silence when I tested on RHEL 7. :)

@ljrk @mcc

Anyway, everything is terrible.

*switches to plan9*

@mattdm @mcc Jop, @soller is of course here too, and I'm absolutely stoked about how far RedoxOS has already progressed! Of course, there's always and will always be a lot to do, but the velocity of the project is making me hopeful.