LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-30-2023, 05:02 PM   #1
TommyC7
Member
 
Registered: Mar 2012
Distribution: Slackware, CentOS, OpenBSD, FreeBSD
Posts: 530

Rep: Reputation: Disabled
Some Dashes/Hyphens in rsync's Manual Page on -current Are Different


Hello folks,

Today when searching for one of rsync's long options that I know for a fact it has, my pager (less) said it wasn't able to find the pattern I fed it, which was just "--compress-choice".

It was however, able to find "--compress" when I noticed just beneath it, the "--compress-choice" option was there but the hyphen/dash after the last 's' in "compress" wasn't the same as the first two hyphens/dashes in the long option.

I fired up a clean -current VM to see if it happened to be some personal changes I made on my own laptop or if it had been my terminal but it wasn't and the clean -current VM had the same issue.

A quick glance through the "rsync.1" file in the source tarball shows the dashes/hyphens that can get searched are escaped. Here's a small snippet:
Quote:
.IP
Rsync supports multiple compression methods and will choose one
for you unless you force the choice using the \fB\-\-compress‐choice\fP
(\fB\-\-zc\fP) option.
.IP
With that said:

1. Does anyone else have this issue on -current specifically with rsync's man page?

There may be others but I can only confirm this issue with rsync on my end.

2. What regular expression could properly and inconsequentially substitute all cases of the un-escaped '-' with the escaped variant?
 
Old 12-31-2023, 04:18 AM   #2
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,817

Rep: Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493
With an iso8859-1 locale, it's the same '-', 2D, so it is easily found by less.

Slackware now has a UTF-8 default locale where it's '‐', HYPHEN, E2 80 90. If you copy this using your mouse: '--compress‐choice', you can find it with less.

Or, you could use a regular expression. Search for '--compress.choice'.

Last edited by Petri Kaukasoina; 12-31-2023 at 04:21 AM.
 
Old 12-31-2023, 04:45 AM   #3
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,901

Rep: Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025
Background reading:
https://lwn.net/Articles/947941/

The hyphen that doesn't match really should be escaped in the man-page in order to make it a '-' ascii 0x2d. It's the same on my CRUX system. Upstream's rsync's man-page is just wrong.


I'm not sure how Slackware builds less, but on CRUX with LESS 643 built using the PCRE2 regex library it seems that the less code doesn't prefix the search term with the needed (*UTF8) prefix to get '.' to match a single multibyte utf8 sequence therefore
/--compress.choice doesn't work, but
/(*UTF8)--compress.choice does. As does:
/--compress...choice (with hyphen being a 3 byte sequence)

I would argue that less should be doing this prefixing internallyš to enable utf8 matching when run in a utf8 locale and that this is a bug, but that might be a matter of opinion (It's possible less devs chose to do this for performance reasons).

-----
1) reading the man-pages for pcre2, seems there are also corresponding options one can pass to the functions. So I assume less isn't doing that.

Last edited by GazL; 12-31-2023 at 05:11 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatic LVM names include hyphens joe30030 Linux - Newbie 8 03-15-2015 11:55 AM
Removing hyphens foma directory Peter Shepard Linux - General 1 12-23-2005 12:35 PM
google hyphens gypsy_rabbi General 2 11-03-2005 04:47 PM
qmail ignores aliases with DASHES (-) in them.. why? ivj Linux - Software 0 07-30-2004 04:20 PM
man pages won't display hyphens TruckStuff Linux - General 10 02-20-2004 11:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration