From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/bash/modifiers.html | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 devdocs/bash/modifiers.html (limited to 'devdocs/bash/modifiers.html') diff --git a/devdocs/bash/modifiers.html b/devdocs/bash/modifiers.html new file mode 100644 index 00000000..c2b9dbc9 --- /dev/null +++ b/devdocs/bash/modifiers.html @@ -0,0 +1,17 @@ +

Modifiers

After the optional word designator, you can add a sequence of one or more of the following modifiers, each preceded by a ‘:’. These modify, or edit, the word or words selected from the history event.

h
+

Remove a trailing pathname component, leaving only the head.

t
+

Remove all leading pathname components, leaving the tail.

r
+

Remove a trailing suffix of the form ‘.suffix’, leaving the basename.

e
+

Remove all but the trailing suffix.

p
+

Print the new command but do not execute it.

q
+

Quote the substituted words, escaping further substitutions.

x
+

Quote the substituted words as with ‘q’, but break into words at spaces, tabs, and newlines. The ‘q’ and ‘x’ modifiers are mutually exclusive; the last one supplied is used.

s/old/new/
+

Substitute new for the first occurrence of old in the event line. Any character may be used as the delimiter in place of ‘/’. The delimiter may be quoted in old and new with a single backslash. If ‘&’ appears in new, it is replaced by old. A single backslash will quote the ‘&’. If old is null, it is set to the last old substituted, or, if no previous history substitutions took place, the last string in a !?string[?] search. If new is null, each matching old is deleted. The final delimiter is optional if it is the last character on the input line.

&
+

Repeat the previous substitution.

g
a
+

Cause changes to be applied over the entire event line. Used in conjunction with ‘s’, as in gs/old/new/, or with ‘&’.

G
+

Apply the following ‘s’ or ‘&’ modifier once to each word in the event.

+

+ Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
Licensed under the GNU Free Documentation License.
+ https://www.gnu.org/software/bash/manual/html_node/Modifiers.html +

+
-- cgit v1.2.3