<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Bash-rarely-used-options</id>
	<title>Bash-rarely-used-options - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Bash-rarely-used-options"/>
	<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Bash-rarely-used-options&amp;action=history"/>
	<updated>2026-05-08T15:52:14Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.2</generator>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Bash-rarely-used-options&amp;diff=16&amp;oldid=prev</id>
		<title>Chubbard: Created page with &quot;Suspect they will be version dependent, but maybe not.    [https://stackoverflow.com/questions/4168371/how-can-i-remove-all-text-after-a-character-in-bash | Original link]  &lt;p...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Bash-rarely-used-options&amp;diff=16&amp;oldid=prev"/>
		<updated>2021-10-15T19:50:19Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Suspect they will be version dependent, but maybe not.    [https://stackoverflow.com/questions/4168371/how-can-i-remove-all-text-after-a-character-in-bash | Original link]  &amp;lt;p...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Suspect they will be version dependent, but maybe not.  &lt;br /&gt;
&lt;br /&gt;
[https://stackoverflow.com/questions/4168371/how-can-i-remove-all-text-after-a-character-in-bash | Original link]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
In Bash (and ksh, zsh, dash, etc.), you can use parameter expansion with % which will remove characters from the end of the string or # which will remove characters from the beginning of the string. If you use a single one of those characters, the smallest matching string will be removed. If you double the character, the longest will be removed.&lt;br /&gt;
&lt;br /&gt;
$ a='hello:world'&lt;br /&gt;
&lt;br /&gt;
$ b=${a%:*}&lt;br /&gt;
$ echo &amp;quot;$b&amp;quot;&lt;br /&gt;
hello&lt;br /&gt;
&lt;br /&gt;
$ a='hello:world:of:tomorrow'&lt;br /&gt;
&lt;br /&gt;
$ echo &amp;quot;${a%:*}&amp;quot;&lt;br /&gt;
hello:world:of&lt;br /&gt;
&lt;br /&gt;
$ echo &amp;quot;${a%%:*}&amp;quot;&lt;br /&gt;
hello&lt;br /&gt;
&lt;br /&gt;
$ echo &amp;quot;${a#*:}&amp;quot;&lt;br /&gt;
world:of:tomorrow&lt;br /&gt;
&lt;br /&gt;
$ echo &amp;quot;${a##*:}&amp;quot;&lt;br /&gt;
tomorrow&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Category:bash]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
</feed>