bug#69532: mv's new -x option should be made orthogonal to -t/-T/default

2024-03-20 Thread Rob Landley
On 3/20/24 14:43, Bernhard Voelker wrote: > On 3/17/24 07:10, Paul Eggert wrote: > Now, extending "exchange" to more arguments is confusing and the > use is not intuitive: >mv -v --exchange a b c d It's also pointless. An atomic exchange on more than 2 files ISN'T ATOMIC. That's why I didn't

bug#69532: mv's new -x option should be made orthogonal to -t/-T/default

2024-03-04 Thread Rob Landley
On 3/4/24 18:43, Dominique Martinet wrote: > Adding Rob to the loop because this impacts compatibility with > toybox/maybe busybox implementations > (Quoting in full for convenience, there's a few more mails in > https://lists.nongnu.org/archive/html/bug-coreutils/2024-03/msg2.html > but we

Re: [PATCH] mv: add --swap (-s) option to atomically swap 2 paths

2024-03-02 Thread Rob Landley
On 3/2/24 05:01, Pádraig Brady wrote: > Ok so there seems to be a bit of consensus for adding this to mv. ... > So how about -x,--swap as the short and long options? Works for me. > Should we add this to install(1) ? No opinion. Rob

Re: [PATCH] mv: add --swap (-s) option to atomically swap 2 paths

2024-03-01 Thread Rob Landley
On 3/1/24 05:05, Petr Malat wrote: > Hi! > On Fri, Mar 01, 2024 at 09:18:31AM +, Padraig Brady wrote: >> On 29/02/2024 22:02, Petr Malat wrote: >> > renameat2() syscall allows atomically swapping 2 paths on one >> > file system. Expose this ability to the user using -s option. >> > >> > *

Re: [PATCH] mv: add --swap (-s) option to atomically swap 2 paths

2024-03-01 Thread Rob Landley
On 3/1/24 03:18, Pádraig Brady wrote: > On 29/02/2024 22:02, Petr Malat wrote: >> renameat2() syscall allows atomically swapping 2 paths on one >> file system. Expose this ability to the user using -s option. >> >> * NEWS: Mention the new option > > Thanks for the patch. > > That was suggested

Re: du enhancement

2023-10-20 Thread Rob Landley
On 10/19/23 23:10, Dragan Simic wrote: > On 2023-10-20 05:56, Kaz Kylheku wrote: >> On 2023-10-19 20:42, Dragan Simic wrote: >>> On 2023-10-20 01:22, Rusty Duplessis wrote: Would be nice to have an option to append a / to the end of directory names, so that you can distinguish between a

Re: Coreutils enhancement: ls: add colorization of mountpoints

2023-10-17 Thread Rob Landley
On 10/17/23 12:05, Parke wrote: >> On 10/16/23 16:50, Parke wrote: >> > I am contemplating extending ls so that mountpoints can be colorized >> > (via LS_COLORS). > > On Tue, Oct 17, 2023 at 2:30 AM Rob Landley wrote: >> But not -F ? > > I had forg

Re: Coreutils enhancement: ls: add colorization of mountpoints

2023-10-17 Thread Rob Landley
On 10/16/23 16:50, Parke wrote: > Hello, coreutils@gnu.org, > > I am contemplating extending ls so that mountpoints can be colorized > (via LS_COLORS). But not -F ? > I'm hoping that a mountpoint can be detected by comparing the st_dev > fields returned by calling stat() on a directory and on

Re: coreutils/man/rm.x - fails to mention POSIX "Refuse to remove path/. and path/.., as well as `.' and `..'

2023-09-25 Thread Rob Landley
On 9/24/23 01:37, James Feeney via GNU coreutils General Discussion wrote: > Sorry, that was probably a bit harsh. No, people used to regularly boggle at why info still exists: https://www.reddit.com/r/gnu/comments/240mle/why_does_gnu_cling_to_info/

Re: [PATCH] printf: add %#s alias to %b

2023-09-08 Thread Rob Landley
On 9/7/23 13:59, Eric Blake wrote: > now that Issue 8 has taken efforts to make it clear that sometimes the > shell deals with characters, and sometimes with bytes; in particular, > environment variables can hold bytes that need not always form > characters in the current locale). If they didn't

Re: [PATCH] printf: add %#s alias to %b

2023-09-06 Thread Rob Landley
On 9/6/23 05:28, Dragan Simic wrote: > Thank you for this detailed clarification. It's good to know that the > 2013, 2016 and 2018 versions/revisions of POSIX actually don't count. You didn't change the URL. You didn't update the SUSvX number. It's still says "issue 7" at the top. That's YOU

Re: [PATCH] printf: add %#s alias to %b

2023-09-05 Thread Rob Landley
On 9/5/23 15:44, Chet Ramey wrote: > On 9/5/23 4:32 PM, Dragan Simic wrote: >> On 2023-09-05 22:25, Chet Ramey wrote: >>> On 9/5/23 3:58 PM, enh wrote: On Fri, Sep 1, 2023 at 6:59 AM Chet Ramey wrote: >>> > I think you'll find that, regardless of its origins, there are more >

Re: [PATCH] printf: add %#s alias to %b

2023-08-31 Thread Rob Landley
On 8/31/23 13:31, Eric Blake wrote: > POSIX Issue 8 will be obsoleting %b (escape sequence interpolation) so > that future Issue 9 can change to having %b (binary literal output) > that aligns with C2x. I.E. you sent an RFC to that effect to the posix list earlier today, and so far the only reply

Re: env: follow up on argv0 setting feature

2023-08-29 Thread Rob Landley
On 8/25/23 08:18, Pádraig Brady wrote: > On 25/08/2023 03:48, Matheus Afonso Martins Moreira wrote: >> About five months ago, I posted an env feature request on this list: >> the ability to set the value of argv[0]. >> >> https://lists.gnu.org/archive/html/coreutils/2023-03/msg2.html >> >> I

Re: [PATCH 4/4] cut: Optionally treat multiple consecutive delimiters as one

2023-08-16 Thread Rob Landley
On 8/15/23 06:31, Pádraig Brady wrote: > On 15/08/2023 11:22, Dragan Simic wrote: >> On 2023-08-10 17:05, Dragan Simic wrote: >>> On 2023-08-01 20:37, Dragan Simic wrote: On 2023-08-01 16:42, Pádraig Brady wrote: > On 01/08/2023 10:07, Dragan Simic wrote: >> Add new command-line

Re: [sort] Suggestion: count keys from the end of record

2023-08-15 Thread Rob Landley
On 8/15/23 05:08, Budi wrote: > so many did and hoped, the most recent: > > https://stackoverflow.com/questions/76892900/sort-text-page-based-on-5th-column-out-of-6-columns-being-troubled-with-as-the I implemented negative keys and came up with some basic tests for them:

Re: [sort] Suggestion: count keys from the end of record

2023-08-14 Thread Rob Landley
On 8/14/23 01:56, Renaud Pacalet wrote: > On 13/08/2023 17:09, Pádraig Brady wrote: >> On 13/08/2023 15:40, Renaud Pacalet wrote: >>> I am a bit surprised that it has never been suggested before but I could >>> not find any trace of it, so here it is: >>> >>> Would it be possible to specify the

Re: [PATCH 4/4] cut: Optionally treat multiple consecutive delimiters as one

2023-08-01 Thread Rob Landley
On 8/1/23 04:07, Dragan Simic wrote: > Add new command-line option and the required logic that allow multiple > consecutive delimiters to be treated as a single delimiter. Of course, > this option is valid only with the cut's field mode. > > This new feature should make cut much more usable in

Re: feature request to support stdin in GNU install

2023-07-26 Thread Rob Landley
On 7/26/23 17:32, Pádraig Brady wrote: > On 26/07/2023 15:55, Dröge, Lars wrote: >> Dear coreutils developers, >> >> I have read many tutorials, where a secret is written to a file, which >> is protected afterwards, like this: >> >> ``` >> generate_secret > keyfile >> chmod 0600 keyfile >>

Re: rm --do-what-i-mean

2023-05-06 Thread Rob Landley
On 5/6/23 09:48, Philip Rowlands wrote: > As mentioned in the coreutils gotchas, rm cannot always delete directory > hierarchies. > > I'm sure the folks on this list could write > > $ find -type d -exec chmod +wx {} + > > in their sleep but it's not the most obvious way out of unwritable >

Re: [PATCH v3 1/6] man2/: use IEC or ISO multiples to clarify long numeric digit strings

2023-02-22 Thread Rob Landley
On 2/21/23 19:34, Alex Colomar wrote: > Hi Rob, > > On 2/21/23 18:00, Rob Landley wrote: >> If you're going to tell people to learn something new: 1<<10 is a kilobyte, >> 1<<20 is a megabyte, 1<<30 is a gigabyte, and so on. I've sometimes used >

Re: [PATCH v3 1/6] man2/: use IEC or ISO multiples to clarify long numeric digit strings

2023-02-21 Thread Rob Landley
On 2/20/23 09:35, Alex Colomar wrote: > On 2/20/23 15:29, Stefan Puiu wrote: >> Hi Alex, > > Hi Stefan, > >>> 4 KiB is not that much better than 4096, since 4096 is easy to read. >>> For higher numbers such as 33554432, it becomes more important to use 32 >>> KiB. >>> For consistency, using 4

Re: mkdir -p competition on the same directory?

2023-02-09 Thread Rob Landley
On 2/9/23 10:33, Pádraig Brady wrote: > On 09/02/2023 16:28, Peng Yu wrote: >> OK. >> >> I see the following output of `sudo dtruss mkdir -p d`. So >> essentially, coreutils first calls system function mkdir to make the >> directory. On error of the system call, it will check the target is a >>

Re: [PATCH] cksum: add --raw option to output a binary digest

2023-02-04 Thread Rob Landley
On 2/4/23 07:51, Pádraig Brady wrote: > --raw output is the most composable format, and also is a > robust way to discard the file name without parsing (escaped) output. Just FYI, 9 years ago I taught toybox md5sum/sha1sum to use -b as "brief", and the same option has been in our sha3sum and so

Re: [PATCH] tee: Add --pipe-check to allow instantly detecting closed outputs

2022-12-11 Thread Rob Landley
On 12/9/22 08:26, Carl Edquist via GNU coreutils General Discussion wrote: >>> Similar to the situation here, i was seeing things annoyingly look like >>> they are still 'alive' longer than they ought to be when providing >>> input from the terminal. >> >> Huh, I never tried that, honestly. > >

Re: dd and gzip/gunzip with large disk images

2022-09-12 Thread Rob Landley
On 9/12/22 10:35, J wrote: > Hi, > > I'm trying to clone a machine. > > The source and target machines are identical in every way, they have the > same hardware and memory. > > I am using a live-dvd to boot the source machine, and then run the > following command from a third machine (a

Re: [PATCH 1/2] factor: add option for printing in x^y format

2022-05-04 Thread Rob Landley
On 5/4/22 02:28, Rasmus Villemoes wrote: > Thanks. I don't care much about what the short option is, but it's quite > important for my use case that it does have a short form. Given the > NetBSD precedent [1], I think -h is fine. We can make the long option > --human-readable or --exponents, I

Re: Allow tail to display data after stream stops sending input after N seconds

2022-04-25 Thread Rob Landley
On 4/25/22 11:42, konsolebox wrote: > On Mon, Apr 25, 2022, 23:56 Pádraig Brady, wrote: > >> On 25/04/2022 15:32, konsolebox wrote: >> > On Mon, Apr 25, 2022, 20:45 Pádraig Brady, > p...@draigbrady.com>> wrote: >> > >> > On 24/04/2022 11:45, konsolebox wrote: >> > > But this could

Re: Allow tail to display data after stream stops sending input after N seconds

2022-04-24 Thread Rob Landley
On 4/24/22 05:45, konsolebox wrote: > A command like this doesn't display data: > > tail -f /var/log/messages -n +1 | grep -e something --line-buffered | tail > > probably because the last tail waits for the pipe to terminate. > > But this could work if there exists an option like -S which

Re: new snapshot available: coreutils-9.0.193-54bec.tar.xz

2022-04-09 Thread Rob Landley
On 4/9/22 09:16, Pádraig Brady wrote: > 0 new test failures on Solaris 10 on SPARC-Enterprise-T5220 I take it the cut -DF support fell by the wayside? Rob

Re: df command reports incorrect usage

2022-03-24 Thread Rob Landley
On 3/24/22 10:26 AM, Fariya F wrote: > Thank you for all the inputs.  > > I have a question what is the meaning of overhead block (its different from > reserved block) and how the number of overhead blocks is  calculated? Not really a df/coreutils question. The command fetches info from the

Re: df command reports incorrect usage

2022-03-22 Thread Rob Landley
On 3/22/22 11:50 AM, Fariya F wrote: > > > This is a 32 bit hardware. This partition has private data in here.  Wild guess: https://github.com/torvalds/linux/commit/fe23cb65c2c3 Rob

Re: df command reports incorrect usage

2022-03-22 Thread Rob Landley
On 3/22/22 9:12 AM, Fariya F wrote: > Hi, > > The version of df command is 1.85. > Kernel version 4.9.31 A 2016 release, plus bugfixes. $ git log --no-merges v4.9..master fs/ext4 | grep ^commit | wc -l 1213 Bit of water under that bridge in the past 8 years. > The fsck check on that partition

Re: tee: add --remove-cr option

2022-02-09 Thread Rob Landley
On 2/9/22 3:28 AM, Nikos Papaspyrou wrote: > On Wed, Feb 9, 2022 at 9:14 AM Nikos Papaspyrou wrote: >> >> On Wed, Feb 9, 2022 at 8:30 AM Bernhard Voelker >> wrote: >> > >> > > More specifically, lines ending with carriage return are sent to the >> > > standard output but not to the files. >>

Re: tee: add --remove-cr option

2022-02-09 Thread Rob Landley
On 2/9/22 1:30 AM, Bernhard Voelker wrote: > On 2/9/22 04:27, Nikos Papaspyrou wrote: >> Notice that the LOG file contains more than can be seen in the standard >> output. Three lines were printed with progress information, each starting >> with a carriage return character (0d). Only the last one

Re: cut -DF

2022-01-25 Thread Rob Landley
On 1/25/22 3:39 PM, Pádraig Brady wrote: > On 25/01/2022 07:55, Assaf Gordon wrote: >> Hello, >> >> Here's an updated patch for "cut -DF". >> Since it's a new code path, it opens the possibility of finally >> supporting multibyte characters with "cut -c". >> >> >> comments very welcomed, >>

Re: cut -DF

2022-01-25 Thread Rob Landley
On 1/25/22 1:55 AM, Assaf Gordon wrote: > Hello, > > Here's an updated patch for "cut -DF". > Since it's a new code path, it opens the possibility of finally > supporting multibyte characters with "cut -c". Don't forget -nb (posix!). Toybox's rounds down to the start of character for both

Re: cut -DF

2022-01-15 Thread Rob Landley
On 1/15/22 6:20 AM, Shehu Dikko wrote: > * Pádraig Brady [2022-01-15] [gmane.comp.gnu.coreutils.general]: >> On 15/01/2022 08:44, Shehu Dikko wrote: >>> [] >>> $ echo one two three four five six seven eight nine | cut -DF 1,5-$ >>> one five six seven eight nine >>> >>> Do please also add the

Re: cut -DF

2022-01-07 Thread Rob Landley
On 1/7/22 9:06 AM, Pádraig Brady wrote: > I'm not sure about the --allow-duplicates long option for -D, > as the duplicate aspect is not the only or even the most important > aspect of that mode. I do like it matches the "-D", though I > don't like "-D" was used for this as I mentioned

Re: cut -DF

2022-01-07 Thread Rob Landley
On 1/6/22 5:02 PM, Assaf Gordon wrote: > Hello, > > On 2022-01-06 7:35 a.m., Pádraig Brady wrote: >> Thanks for taking the time to consolidate options/functionality >> across different implementations.  This is important for users. >> Some notes below... >> &g

Re: cut -DF

2022-01-05 Thread Rob Landley
On 1/5/22 2:19 PM, Assaf Gordon wrote: >> This is working and in use in Android, and now in busybox, and it would >> simplify >> my regression test suite if coreutils was in sync, so I thought I'd ask if >> you >> were interested. >> > > I personally like the idea (at the very list "-D" will

cut -DF

2022-01-05 Thread Rob Landley
Around 5 years ago toybox added the -D, -F, and -O options to cut: -D Don't sort/collate selections or match -fF lines without delimiter -F Select fields separated by DELIM regex -O Output delimiter (default one space for -F, input delim for -f) This lets you do: $ echo one two