<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Bash on Karpoke - Just Another Blog</title><link>http://karpoke.ignaciocano.com/tags/bash/</link><description>Recent content in Bash on Karpoke - Just Another Blog</description><generator>Hugo -- 0.159.0</generator><language>es</language><lastBuildDate>Mon, 01 Aug 2011 19:23:00 +0100</lastBuildDate><atom:link href="http://karpoke.ignaciocano.com/tags/bash/index.xml" rel="self" type="application/rss+xml"/><item><title>Limitando el número de procesos por usuario</title><link>http://karpoke.ignaciocano.com/2011/08/01/limitando-el-numero-de-procesos-por-usuario/</link><pubDate>Mon, 01 Aug 2011 19:23:00 +0100</pubDate><guid>http://karpoke.ignaciocano.com/2011/08/01/limitando-el-numero-de-procesos-por-usuario/</guid><description>&lt;p&gt;Mediante el comando &lt;code&gt;ulimit&lt;/code&gt; podemos consultar y controlar el valor de los
recursos disponibles para la consola y los &lt;a href="http://karpoke.ignaciocano.com/2010/12/16/mejora-del-rendimiento-interactivo-agrupando-tareas-por-terminal/"&gt;procesos que puedan ser iniciados
desde ella&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Las diferentes opciones que acepta este comando son:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;-a All current limits are reported
-b The maximum socket buffer size
-c The maximum size of core files created
-d The maximum size of a process’s data segment
-e The maximum scheduling priority (&amp;#34;nice&amp;#34;)
-f The maximum size of files written by the shell and its children
-i The maximum number of pending signals
-l The maximum size that may be locked into memory
-m The maximum resident set size (many systems do not honor this limit)
-n The maximum number of open file descriptors (most systems do not allow this value to be set)
-p The pipe size in 512-byte blocks (this may not be set)
-q The maximum number of bytes in POSIX message queues
-r The maximum real-time scheduling priority
-s The maximum stack size
-t The maximum amount of cpu time in seconds
-u The maximum number of processes available to a single user
-v The maximum amount of virtual memory available to the shell and, on some systems, to its children
-x The maximum number of file locks
-T The maximum number of threads
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Para consultar todos los valores asignados actualmente:&lt;/p&gt;</description></item><item><title>Variables variables en Bash</title><link>http://karpoke.ignaciocano.com/2011/06/29/variables-variables-en-bash/</link><pubDate>Wed, 29 Jun 2011 12:11:00 +0100</pubDate><guid>http://karpoke.ignaciocano.com/2011/06/29/variables-variables-en-bash/</guid><description>&lt;p&gt;Las variables variables se utilizan cuando queremos tener nombres de
variables que puedan usarse y modificarse de forma dinámica. &lt;a href="http://php.net/manual/en/language.variables.variable.php"&gt;PHP
permite su uso&lt;/a&gt; de forma directa:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;&amp;lt;?php
$a = &amp;#39;hello&amp;#39;;
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Una variable variable toma el valor de una variable y lo usa para el
nombre de la variable. Podemos utilizar &amp;ldquo;hello&amp;rdquo; como nombre de variable
utilizando dos signos de dólar:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;&amp;lt;?php
$$a = &amp;#39;world&amp;#39;;
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;En este punto tenemos dos variables, &lt;code&gt;$a&lt;/code&gt; que contiene &amp;ldquo;hello&amp;rdquo; y
&lt;code&gt;$hello&lt;/code&gt; que contiene &amp;ldquo;world&amp;rdquo;. Así, las siguientes instrucciones
escriben &amp;ldquo;hello world&amp;rdquo;:&lt;/p&gt;</description></item><item><title>Intercambio de los valores de dos variables</title><link>http://karpoke.ignaciocano.com/2010/12/03/intercambio-de-los-valores-de-dos-variables/</link><pubDate>Fri, 03 Dec 2010 21:01:00 +0100</pubDate><guid>http://karpoke.ignaciocano.com/2010/12/03/intercambio-de-los-valores-de-dos-variables/</guid><description>&lt;p&gt;&lt;img alt="Teleporter" loading="lazy" src="http://karpoke.ignaciocano.com/images/teleporter-300x299.jpg"&gt;&lt;/p&gt;
&lt;p&gt;En algunos lenguajes, intercambiar el valor de la variable &lt;code&gt;a&lt;/code&gt; por el de
la variable &lt;code&gt;b&lt;/code&gt; implica, explícitamente, utilizar una variable temporal:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;t = a;
a = b;
b = t;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;En Python:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;a, b = b, a
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Pero esperen, aún hay más:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;a, b, c, d = d, c, b, a
&lt;/code&gt;&lt;/pre&gt;&lt;hr&gt;
&lt;h4 id="actualizado-el-31-de-julio-de-2011"&gt;Actualizado el 31 de julio de 2011&lt;/h4&gt;
&lt;p&gt;En &lt;a href="http://www.commandlinefu.com/commands/view/8937/multiple-variable-assignments-from-command-output-in-bash"&gt;Bash&lt;/a&gt;:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;$ read a b c &amp;lt;&amp;lt;&amp;lt; $(echo $c $b $a)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;a href="http://www.commandlinefu.com/commands/view/8943/multiple-variable-assignments-from-command-output-in-bash"&gt;Otra manera&lt;/a&gt;:&lt;/p&gt;</description></item></channel></rss>