<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Bash on ohneKontur – der Blog</title>
		<link>https://www.ohnekontur.de/tags/bash/</link>
		<description>Recent content in Bash 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/bash/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>
			<item>
				<title>How to get a process list if you can’t fork any processes?</title>
				<link>https://www.ohnekontur.de/2013/01/05/how-to-get-a-process-list-if-you-cant-fork-any-processes/</link>
				<pubDate>Sat, 05 Jan 2013 09:29:19 +0000</pubDate>
				<guid>https://www.ohnekontur.de/2013/01/05/how-to-get-a-process-list-if-you-cant-fork-any-processes/</guid>
				<description>&lt;p&gt;Recently I got the question what to do if one got a bash session but can’t fork processes on a Linux system.&lt;br&gt;&#xA;So here is an attempt to get a processlist just by using bash buildins:&lt;/p&gt;&#xA;&lt;pre lang=&#34;bash&#34;&gt;OLDPWD=$PWD&#xA;cd /proc&#xA;for x in [0-9]*&#xA;do&#xA;read cmd &amp;lt; /proc/${x}/comm&#xA;read cmdl &amp;lt; /proc/${x}/cmdline&#xA;printf &#34;%8s - %15s - %s&#34; $x $cmd $cmdl&#xA;echo&#xA;done&#xA;cd $OLDPWD&#xA;&lt;/pre&gt;</description>
			</item>
			<item>
				<title>Swapfile – Swap ohne eigenes Dateisystem</title>
				<link>https://www.ohnekontur.de/2009/11/29/swapfile-swap-ohne-eigenes-dateisystem/</link>
				<pubDate>Sun, 29 Nov 2009 15:10:43 +0000</pubDate>
				<guid>https://www.ohnekontur.de/2009/11/29/swapfile-swap-ohne-eigenes-dateisystem/</guid>
				<description>&lt;p&gt;Ich dachte bis vor kurzen um unter Linux zu Swap-en bräuche man eine Swap Partition.&lt;/p&gt;&#xA;&lt;p&gt;Es zeigte sich, dass das nur halb richtig ist : Den man kann auch eine Datei, die sich in einem normalen Dateisystem befindet (ext3) als Swap Partition Mounten.&lt;/p&gt;&#xA;&lt;p&gt;Warscheinlich ist das nicht die beste, schönste oder schnellste Methode,&lt;br&gt;&#xA;aber mir spaart es das sehr mühevolle ändern meiner Partitionen.&lt;/p&gt;&#xA;&lt;p&gt;Als machen wirs kurz:&lt;/p&gt;&#xA;&lt;pre lang=&#34;bash&#34;&gt;dd if=/dev/zero of=/Datei/in/die/geswapt/werden/soll.swp bs=1M count=512&#xA;#count gibt die Größe in MB an und kann nach belieben geändert werden&#xA;mkswap /Datei/in/die/geswapt/werden/soll.swp&#xA;swapon /Datei/in/die/geswapt/werden/soll.swp&#xA;echo &gt;&gt;/etc/fstab &#34;#add new swapfiles&#34;&#xA;echo &gt;&gt;/etc/fstab &#34;/Datei/in/die/geswapt/werden/soll.swp swap swap noauto 0 0&#34;&#xA;swapon -a&#xA;&lt;/pre&gt;</description>
			</item>
			<item>
				<title>Was man besser nicht tun sollte</title>
				<link>https://www.ohnekontur.de/2009/10/27/was-man-besser-nicht-tun-sollt/</link>
				<pubDate>Tue, 27 Oct 2009 22:33:47 +0000</pubDate>
				<guid>https://www.ohnekontur.de/2009/10/27/was-man-besser-nicht-tun-sollt/</guid>
				<description>&lt;p&gt;Okay zugegeben die meisten werden es wissen,&lt;br&gt;&#xA;aber trotzdem, als Hinweis für alle dies nicht wissen:&lt;/p&gt;&#xA;&lt;p&gt;macht das nicht:&lt;/p&gt;&#xA;&lt;pre lang=&#34;bash&#34;&gt;rm -r /etc/*&#xA;&lt;/pre&gt;&#xA;&lt;p&gt;durch ein doofes Missgeschick ist mir das passiert und es ist kein Spaß.&lt;/p&gt;&#xA;&lt;p&gt;Damit wären wir beim zweiten Punkt:&lt;/p&gt;&#xA;&lt;p&gt;Sorgt dafür das im Backup die Dateirechte erhalten werden.&lt;/p&gt;&#xA;&lt;p&gt;So genug der Altklugheit, aber ich musstes mal loswerden.&lt;br&gt;&#xA;Ja ich weiß den kram erzählt jeder und ich glaube jeder muss selbst die Erfahrung machen das man die dinge einhalten sollte ;)&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
