<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Function Built With Builtins on ohneKontur – der Blog</title>
		<link>https://www.ohnekontur.de/tags/function-built-with-builtins/</link>
		<description>Recent content in Function Built With Builtins on ohneKontur – der Blog</description>
		<generator>Hugo</generator>
		<language>de-DE</language>
		
		
		
		
			<lastBuildDate>Sun, 17 Feb 2013 08:48:32 +0000</lastBuildDate>
		
			<atom:link href="https://www.ohnekontur.de/tags/function-built-with-builtins/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>cat as a shell builtin</title>
				<link>https://www.ohnekontur.de/2013/02/17/making-cat-a-shell-builtin/</link>
				<pubDate>Sun, 17 Feb 2013 08:48:32 +0000</pubDate>
				<guid>https://www.ohnekontur.de/2013/02/17/making-cat-a-shell-builtin/</guid>
				<description>&lt;p&gt;Recently i blogged about  &lt;a href=&#34;https://www.ohnekontur.de/2013/01/05/how-to-get-a-process-list-if-you-cant-fork-any-processes/&#34;&gt;how to get a process list if you aren’t able to fork any processes&lt;/a&gt; . Also a process list is allways handy, i allways find cat a very usefull tool too. But as you might have noticed cat is not a shell builtin. So everytime cat is called a new process needs to be forked. In case you can’t fork processes it’s a problem, and even if you can fork them you may save resources by “creating” a shell builtin cat.&lt;br&gt;&#xA;So lets do this,&lt;br&gt;&#xA;open your &lt;strong&gt;.profile&lt;/strong&gt; for usage with your user only or /etc/profile for global usage (You may also use your &lt;strong&gt;.bashrc&lt;/strong&gt; or &lt;strong&gt;.zshrc&lt;/strong&gt; instead).&lt;br&gt;&#xA;Append the following lines to the file:&lt;br&gt;&#xA;&lt;del datetime=&#34;2013-02-21T20:50:12+00:00&#34;&gt;&lt;br /&gt; #pseudo bash builtin cat function&lt;br /&gt; function cat { echo “$(&amp;lt; $1)&amp;quot; } &lt;/del&gt;&lt;br&gt;&#xA;Siehe Kommentar :)&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
