util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Haelwenn (lanodan) Monnier" <contact@hacktivis.me>
To: util-linux@vger.kernel.org
Cc: "Haelwenn (lanodan) Monnier" <contact@hacktivis.me>
Subject: [PATCH] rename: change "expression" to "original"
Date: Sun, 22 Jun 2025 01:26:43 +0200	[thread overview]
Message-ID: <20250621232642.17613-2-contact@hacktivis.me> (raw)

As rename(1) doesn't uses an expression (like regex or glob) but rather a substring.
---
Note: Not on the mailing-list so CC me on replies

 misc-utils/rename.1.adoc | 12 ++++++------
 misc-utils/rename.c      |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/misc-utils/rename.1.adoc b/misc-utils/rename.1.adoc
index b8ea2bfdf..e5ba17e7a 100644
--- a/misc-utils/rename.1.adoc
+++ b/misc-utils/rename.1.adoc
@@ -20,11 +20,11 @@ rename - rename files
 
 == SYNOPSIS
 
-*rename* [options] _expression replacement file_...
+*rename* [options] _original replacement file_...
 
 == DESCRIPTION
 
-*rename* will rename the specified files by replacing the first occurrence of _expression_ in their name by _replacement_.
+*rename* will rename the specified files by replacing the first occurrence of the _original_ substring in their name by _replacement_.
 
 == OPTIONS
 
@@ -38,10 +38,10 @@ Show which files were renamed, if any.
 Do not make any changes; add *--verbose* to see what would be made.
 
 *-a*, *--all*::
-Replace all occurrences of _expression_ rather than only the first one.
+Replace all occurrences of _original_ rather than only the first one.
 
 *-l*, *--last*::
-Replace the last occurrence of _expression_ rather than the first one.
+Replace the last occurrence of _original_ rather than the first one.
 
 *-o*, *--no-overwrite*::
 Do not overwrite existing files. When *--symlink* is active, do not overwrite symlinks pointing to existing targets.
@@ -57,9 +57,9 @@ The renaming has no safeguards by default or without any one of the options *--n
 
 == EDGE CASES
 
-If the _expression_ is empty, then by default _replacement_ will be added to the start of the filename. With *--all*, _replacement_ will be inserted in between every two characters of the filename, as well as at the start and end.
+If the _original_ is empty, then by default _replacement_ will be added to the start of the filename. With *--all*, _replacement_ will be inserted in between every two characters of the filename, as well as at the start and end.
 
-Normally, only the final path component of a filename is updated. (Or with *--symlink*, only the final path component of the link.) But if either _expression_ or _replacement_ contains a _/_, the full path is updated. This can cause a file to be moved between folders. Creating folders, and moving files between filesystems, is not supported.
+Normally, only the final path component of a filename is updated. (Or with *--symlink*, only the final path component of the link.) But if either _original_ or _replacement_ contains a _/_, the full path is updated. This can cause a file to be moved between folders. Creating folders, and moving files between filesystems, is not supported.
 
 == INTERACTIVE MODE
 
diff --git a/misc-utils/rename.c b/misc-utils/rename.c
index bb2e3103d..5eb8f4429 100644
--- a/misc-utils/rename.c
+++ b/misc-utils/rename.c
@@ -251,7 +251,7 @@ static void __attribute__((__noreturn__)) usage(void)
 	FILE *out = stdout;
 	fputs(USAGE_HEADER, out);
 	fprintf(out,
-	      _(" %s [options] <expression> <replacement> <file>...\n"),
+	      _(" %s [options] <original> <replacement> <file>...\n"),
 		program_invocation_short_name);
 
 	fputs(USAGE_SEPARATOR, out);

base-commit: c8e5b8a818323af30ec656f079c7feadaeeb13c3
-- 
2.49.0


             reply	other threads:[~2025-06-21 23:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-21 23:26 Haelwenn (lanodan) Monnier [this message]
2025-06-22  9:15 ` [PATCH] rename: change "expression" to "original" Nuno Silva
2025-06-22  9:49   ` Dirk Gouders
2025-06-22 10:36   ` Dirk Gouders
2025-06-22 15:51 ` Benno Schulenberg
2025-06-30 12:08   ` Karel Zak
2025-07-01 16:03     ` Haelwenn (lanodan) Monnier
     [not found] ` <87cyawp26b.fsf@ist.utl.pt>
2025-06-22 21:34   ` Haelwenn (lanodan) Monnier
2025-07-01 16:01 ` [PATCH v2] rename: change "expression" to "substring" Haelwenn (lanodan) Monnier
2025-07-02  8:03   ` Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250621232642.17613-2-contact@hacktivis.me \
    --to=contact@hacktivis.me \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).