<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>TUX-ES.com &#187; shell script</title>
	<atom:link href="http://www.tux-es.com/project1/tag/shell-script/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tux-es.com/project1</link>
	<description></description>
	<lastBuildDate>Wed, 26 May 2010 14:53:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>es</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Shell script: expect o autoexpect, esa es la cuestión</title>
		<link>http://www.tux-es.com/project1/2010/02/shell-script-expect-o-autoexpect-esa-es-la-cuestion/</link>
		<comments>http://www.tux-es.com/project1/2010/02/shell-script-expect-o-autoexpect-esa-es-la-cuestion/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 16:24:33 +0000</pubDate>
		<dc:creator>macuriel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[shell script]]></category>

		<guid isPermaLink="false">http://www.tux-es.com/project1/?p=622</guid>
		<description><![CDATA[Bien es sabido por muchos de las virtudes de la herramienta expect para desarrollar shell scripts automatizados a través del método:
1.) stdin
2.) ¿qué stdout/stderr espero?
3.) stdin
4.) ¿qué stdout/stderr espero?
&#8230;..
Por ser breve, es un lenguaje pensado casi exclusivamente para convertir sesiones interactivas de ftp, telnet, ssh, etc&#8230; en sesiones automáticas. Casi más sorprendente, es que añadiendo [...]]]></description>
			<content:encoded><![CDATA[<p>Bien es sabido por muchos de las virtudes de la herramienta <a href="http://expect.nist.gov/">expect</a> para desarrollar shell scripts automatizados a través del método:</p>
<p>1.) stdin<br />
2.) ¿qué stdout/stderr espero?<br />
3.) stdin<br />
4.) ¿qué stdout/stderr espero?<br />
&#8230;..</p>
<p>Por ser breve, es un lenguaje pensado casi exclusivamente para convertir sesiones <strong>interactivas</strong> de ftp, telnet, ssh, etc&#8230; en sesiones <strong>automáticas</strong>. Casi más sorprendente, es que añadiendo el módulo TK, podremos automatizar sesiones de X11, wow!!!!</p>
<p>Pero este artículo no quiere ser un tutorial de expect, ni tampoco una presentación formal, su web es bastante buena para intentar hacer una copia <img src='http://www.tux-es.com/project1/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . Pretendo enseñar, y en otros casos recordar, que no es necesario saber nada, o casi nada de expect para poder utilizarlo, gracias a <strong><a href="http://expect.nist.gov/example/autoexpect.man.html">autoexpect</a></strong>.</p>
<p>Este script nos abrirá una sesión de comando &#8220;script&#8221;, y grabará toda la sesión interactiva. Una vez que salgamos de la sesión con &#8220;exit&#8221;, creará un script de expect que podremos ejecutar directamente. wow!!!!</p>
<p>Cosas a tener en cuenta:</p>
<p>- Cualquier salida por pantalla variable, tipo fecha, hora, y cosas así, nos obligará a editar el script expect final, y poner expresiones regulares. Genial!<br />
- Seguro que hay más, espero esos comentarios <img src='http://www.tux-es.com/project1/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>En la siguiente página incluyo el código del autoexpect, no como referencia, sino como idea general. La recomendación que os hago es visitar la  <a href="http://expect.nist.gov/">web oficial de expect</a>, descargar las últimas <a href="http://expect.nist.gov/old/expect-5.44.1.tar.gz">fuentes de expect</a>, descomprimir, y buscar en el directorio example/ el script autoexpect. En la versión que he descargado yo, he tenido que modificarlo para poner la ruta absoluta de expect en la primera línea:</p>
<p><span id="more-622"></span></p>
<pre class="brush: js">
#!/usr/bin/expect
# Name: autoexpect - generate an Expect script from watching a session
#
# Description:
#
# Given a program name, autoexpect will run that program.  Otherwise
# autoexpect will start a shell.  Interact as desired.  When done, exit
# the program or shell.  Autoexpect will create a script that reproduces
# your interactions.  By default, the script is named script.exp.
# See the man page for more info.
#
# Author: Don Libes, NIST
# Date: June 30 1995
# Version: 1.4b                                                         

set filename "script.exp"
set verbose 1
set conservative 0
set promptmode 0
set option_keys ""       

proc check_for_following {type} {
        if {![llength [uplevel set argv]]} {
                puts "autoexpect: [uplevel set flag] requires following $type"
                exit 1
        }
}                                                                             

while {[llength $argv]>0} {
        set flag [lindex $argv 0]
        if {0==[regexp "^-" $flag]} break
        set argv [lrange $argv 1 end]
        switch -- $flag \
          "-c" {
                set conservative 1
        } "-C" {
                check_for_following character
                lappend option_keys [lindex $argv 0] ctoggle
                set argv [lrange $argv 1 end]
        } "-p" {
                set promptmode 1
        } "-P" {
                check_for_following character
                lappend option_keys [lindex $argv 0] ptoggle
                set argv [lrange $argv 1 end]
        } "-Q" {
                check_for_following character
                lappend option_keys [lindex $argv 0] quote
                set argv [lrange $argv 1 end]
        } "-f" {
                check_for_following filename
                set filename [lindex $argv 0]
                set argv [lrange $argv 1 end]
        } "-quiet" {
                set verbose 0
        } default {
                break
        }
}                                                           

#############################################################
# Variables     Descriptions
#############################################################
# userbuf       buffered characters from user
# procbuf       buffered characters from process
# lastkey       last key pressed by user
#               if undefined, last key came from process
# echoing       if the process is echoing
#############################################################

# Handle a character that came from user input (i.e., the keyboard)
proc input {c} {
        global userbuf lastkey                                     

        send -- $c
        append userbuf $lastkey
        set lastkey $c
}                              

# Handle a null character from the keyboard
proc input_null {} {
        global lastkey userbuf procbuf echoing

        send -null

        if {$lastkey == ""} {
                if {$echoing} {
                        sendcmd "$userbuf"
                }
                if {$procbuf != ""} {
                        expcmd "$procbuf"
                }
        } else {
                sendcmd "$userbuf"
                if {$echoing} {
                        expcmd "$procbuf"
                        sendcmd "$lastkey"
                }
        }
        cmd "send -null"
        set userbuf ""
        set procbuf ""
        set lastkey ""
        set echoing 0
}                                         

# Handle a character that came from the process
proc output {s} {
        global lastkey procbuf userbuf echoing 

        send_user -raw -- $s

        if {$lastkey == ""} {
                if {!$echoing} {
                        append procbuf $s
                } else {
                        sendcmd "$userbuf"
                        expcmd "$procbuf"
                        set echoing 0
                        set userbuf ""
                        set procbuf $s
                }
                return
        }                                 

        regexp (.)(.*) $s dummy c tail
        if {$c == $lastkey} {
                if {$echoing} {
                        append userbuf $lastkey
                        set lastkey ""
                } else {
                        if {$procbuf != ""} {
                                expcmd "$procbuf"
                                set procbuf ""
                        }
                        set echoing 1
                }
                append procbuf $s                

                if {[string length $tail]} {
                        sendcmd "$userbuf$lastkey"
                        set userbuf ""
                        set lastkey ""
                        set echoing 0
                }
        } else {
                if {!$echoing} {
                        expcmd "$procbuf"
                }
                sendcmd "$userbuf$lastkey"
                set procbuf $s
                set userbuf ""
                set lastkey ""
                set echoing 0
        }
}                                                 

# rewrite raw strings so that can appear as source code but still reproduce
# themselves.
proc expand {s} {
        regsub -all "\\\\" $s "\\\\\\\\" s
        regsub -all "\r" $s "\\r"  s
        regsub -all "\"" $s "\\\"" s
        regsub -all "\\\[" $s "\\\[" s
        regsub -all "\\\]" $s "\\\]" s
        regsub -all "\\\$" $s "\\\$" s                                     

        return $s
}                

# generate an expect command
proc expcmd {s} {
        global promptmode   

        if {$promptmode} {
                regexp ".*\[\r\n]+(.*)" $s dummy s
        }                                         

        cmd "expect -exact \"[expand $s]\""
}                                          

# generate a send command
proc sendcmd {s} {
        global send_style conservative

        if {$conservative} {
                cmd "sleep .1"
        }                     

        cmd "send$send_style -- \"[expand $s]\""
}                                               

# generate any command
proc cmd {s} {
        global fd
        puts $fd "$s"
}                     

proc verbose_send_user {s} {
        global verbose      

        if {$verbose} {
                send_user -- $s
        }
}                              

proc ctoggle {} {
        global conservative send_style

        if {$conservative} {
                cmd "# conservative mode off - adding no delays"
                verbose_send_user "conservative mode off\n"
                set conservative 0
                set send_style ""
        } else {
                cmd "# prompt mode on - adding delays"
                verbose_send_user "conservative mode on\n"
                set conservative 1
                set send_style " -s"
        }
}                                                               

proc ptoggle {} {
        global promptmode

        if {$promptmode} {
                cmd "# prompt mode off - now looking for complete output"
                verbose_send_user "prompt mode off\n"
                set promptmode 0
        } else {
                cmd "# prompt mode on - now looking only for prompts"
                verbose_send_user "prompt mode on\n"
                set promptmode 1
        }
}                                                                        

# quote the next character from the user
proc quote {} {
        expect_user -re .
        send -- $expect_out(buffer)
}                                       

if {[catch {set fd [open $filename w]} msg]} {
        puts $msg
        exit
}
exec chmod +x $filename
verbose_send_user "autoexpect started, file is $filename\n"

# calculate a reasonable #! line
set expectpath /usr/local/bin           ;# prepare default
foreach dir [split $env(PATH) :] {      ;# now look for real location
        if {[file executable $dir/expect] &#038;&#038; ![file isdirectory $dir/expect]} {
                set expectpath $dir
                break
        }
}                                                                              

cmd "#![set expectpath]/expect -f
#
# This Expect script was generated by autoexpect on [timestamp -format %c]
# Expect and autoexpect were both written by Don Libes, NIST."
cmd {#
# Note that autoexpect does not guarantee a working script.  It
# necessarily has to guess about certain things.  Two reasons a script
# might fail are:
#
# 1) timing - A surprising number of programs (rn, ksh, zsh, telnet,
# etc.) and devices discard or ignore keystrokes that arrive "too
# quickly" after prompts.  If you find your new script hanging up at
# one spot, try adding a short sleep just before the previous send.
# Setting "force_conservative" to 1 (see below) makes Expect do this
# automatically - pausing briefly before sending each character.  This
# pacifies every program I know of.  The -c flag makes the script do
# this in the first place.  The -C flag allows you to define a
# character to toggle this mode off and on.                               

set force_conservative 0  ;# set to 1 to force conservative mode even if
                          ;# script wasn't run conservatively originally
if {$force_conservative} {
        set send_slow {1 .1}
        proc send {ignore arg} {
                sleep .1
                exp_send -s -- $arg
        }
}                                                                       

#
# 2) differing output - Some programs produce different output each time
# they run.  The "date" command is an obvious example.  Another is
# ftp, if it produces throughput statistics at the end of a file
# transfer.  If this causes a problem, delete these patterns or replace
# them with wildcards.  An alternative is to use the -p flag (for
# "prompt") which makes Expect only look for the last line of output
# (i.e., the prompt).  The -P flag allows you to define a character to
# toggle this mode off and on.
#
# Read the man page for more info.
#
# -Don

}

cmd "set timeout -1"
if {$conservative} {
        set send_style " -s"
        cmd "set send_slow {1 .1}"
} else {
        set send_style ""
}

if {[llength $argv]>0} {
        eval spawn -noecho $argv
        cmd "spawn $argv"
} else {
        spawn -noecho $env(SHELL)
        cmd "spawn \$env(SHELL)"
}

cmd "match_max 100000"

set lastkey ""
set procbuf ""
set userbuf ""
set echoing 0

remove_nulls 0

eval interact $option_keys {
    -re . {
        input $interact_out(0,string)
    } -o -re .+ {
        output $interact_out(0,string)
    } eof {
        cmd "expect eof"
        return
    }
}

close $fd
verbose_send_user "autoexpect done, file is $filename\n"
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.tux-es.com/project1/2010/02/shell-script-expect-o-autoexpect-esa-es-la-cuestion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Script: consulta de saldo de tarjeta restaurant v.2.0</title>
		<link>http://www.tux-es.com/project1/2010/02/script-consulta-de-saldo-de-tarjeta-restaurant-v-2-0/</link>
		<comments>http://www.tux-es.com/project1/2010/02/script-consulta-de-saldo-de-tarjeta-restaurant-v-2-0/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 09:46:53 +0000</pubDate>
		<dc:creator>macuriel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[shell script]]></category>

		<guid isPermaLink="false">http://www.tux-es.com/project1/?p=618</guid>
		<description><![CDATA[Debido a algunos cambios que han realizado en la web de Ticket Restaurant, he tenido que modificar el script original para adaptarlo. Recordad el artículo anterior con el script y la explicación. Resumen de modificaciones que han realizado:
- Todas las urls ahora tienen como base www.ticketrestaurantcard.es
- Se ha incluído un nuevo campo en el envío del [...]]]></description>
			<content:encoded><![CDATA[<p>Debido a algunos cambios que han realizado en la web de Ticket Restaurant, he tenido que modificar el script original para adaptarlo. <a href="http://www.tux-es.com/project1/2009/11/script-consulta-de-saldo-de-tarjeta-restaurant/ ">Recordad el artículo anterior con el script y la explicación.</a> Resumen de modificaciones que han realizado:</p>
<p>- Todas las urls ahora tienen como base www.ticketrestaurantcard.es</p>
<p>- Se ha incluído un nuevo campo en el envío del POST: swlang</p>
<p>Como véis, son cambios normales y poco entrenidos; estaba deseando que me obligaran a cambiar la expresión regular, lástima!</p>
<p>¿Será un buen día para empezar con el laboratorio de expresiones regulares?</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">http://www.tux-es.com/project1/2009/11/script-consulta-de-saldo-de-tarjeta-restaurant/</div>
<p>Como siempre, si alguien tiene alguna pregunta sobre el script, os invito a comentarlo.</p>
<pre class="brush: js">#!/bin/bash

export AGENT="Mozilla/5.0 (X11; U; Linux i686; es-ES; rv:1.8) Gecko/20051111 Firefox/1.5"

export LOGINURL="https://www.ticketrestaurantcard.es/TRC/index.html"
export POSTLOGIN="https://www.ticketrestaurantcard.es/TRC/checkUserLogin.php"
export POSTDATA="swlang=es&amp;user=usuario&amp;passwd=password&amp;type=trc"

curl -s -A '${AGENT}' -d "${POSTDATA}" -c ticketrestaurant.cookie -o login1.out -e ${LOGINURL} ${POSTLOGIN}
curl -s -A '${AGENT}' -b ticketrestaurant.cookie -o login2.out -e ${POSTLOGIN} https://www.ticketrestaurantcard.es/TRC/home.html
curl -s -A '${AGENT}' -b ticketrestaurant.cookie -o login3.out -e https://www.ticketrestaurantcard.es/TRC/home.html https://www.ticketrestaurantcard.es/TRC/consulta_tarjeta.html
curl -s -A '${AGENT}' -b ticketrestaurant.cookie -o login4.out -e https://www.ticketrestaurantcard.es/TRC/consulta_tarjeta.html https://www.ticketrestaurantcard.es/TRC/logout.html
SALDO=`cat login3.out | sed -n '/SALDO/p' | sed 's/.* \([0-9]*,[0-9]*\) .*/\1/g'`
clear
MAIL_BODY=`echo "Su saldo Sr. Señor: ${SALDO} euros" &gt; /tmp/mail.body`
mail email@domain.com -s "Saldo Tarjeta Restaurant: ${SALDO} euros" &lt; /dev/null</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.tux-es.com/project1/2010/02/script-consulta-de-saldo-de-tarjeta-restaurant-v-2-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Script: consulta de saldo de tarjeta restaurant</title>
		<link>http://www.tux-es.com/project1/2009/11/script-consulta-de-saldo-de-tarjeta-restaurant/</link>
		<comments>http://www.tux-es.com/project1/2009/11/script-consulta-de-saldo-de-tarjeta-restaurant/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 09:49:58 +0000</pubDate>
		<dc:creator>macuriel</dc:creator>
				<category><![CDATA[Laboratorio]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[shell script]]></category>

		<guid isPermaLink="false">http://www.tux-es.com/project1/?p=518</guid>
		<description><![CDATA[Hoy inaguramos la sección de Laboratorio incluyendo el primer script de automatización de &#8220;tareas web&#8221;.
Este script consulta una página de Gestión de Tarjeta Restaurant, y consulta el saldo para enviar un email al usuario elegido. Parece un simpleza, pero podemos aprender varias cosas dado que es una buena plantilla para hacer nuestros scripts propios.

#!/bin/bash

export AGENT="Mozilla/5.0 [...]]]></description>
			<content:encoded><![CDATA[<p>Hoy inaguramos la sección de Laboratorio incluyendo el primer script de automatización de &#8220;tareas web&#8221;.</p>
<p>Este script consulta una página de Gestión de Tarjeta Restaurant, y consulta el saldo para enviar un email al usuario elegido. Parece un simpleza, pero podemos aprender varias cosas dado que es una buena plantilla para hacer nuestros scripts propios.</p>
<pre type="syntaxhighlighter" class="brush: js">
#!/bin/bash

export AGENT="Mozilla/5.0 (X11; U; Linux i686; es-ES; rv:1.8) Gecko/20051111 Firefox/1.5"

export LOGINURL="https://ticketrestaurant.geanetondemand.com/TRC/index.html"
export POSTLOGIN="https://ticketrestaurant.geanetondemand.com/TRC/checkUserLogin.php"
export POSTDATA="user=usuario&amp;passwd=password&amp;type=trc"

curl -s -A '${AGENT}' -d "${POSTDATA}" -c ticketrestaurant.cookie -o login1.out -e ${LOGINURL} ${POSTLOGIN}
curl -s -A '${AGENT}' -b ticketrestaurant.cookie -o login2.out -e ${POSTLOGIN} https://ticketrestaurant.geanetondemand.com/TRC/home.html
curl -s -A '${AGENT}' -b ticketrestaurant.cookie -o login3.out -e https://ticketrestaurant.geanetondemand.com/TRC/home.html https://ticketrestaurant.geanetondemand.com/TRC/consulta_tarjeta.html
curl -s -A '${AGENT}' -b ticketrestaurant.cookie -o login4.out -e https://ticketrestaurant.geanetondemand.com/TRC/consulta_tarjeta.html https://ticketrestaurant.geanetondemand.com/TRC/logout.html
SALDO=`cat login3.out | sed -n '/SALDO/p' | sed 's/.* \([0-9]*,[0-9]*\) .*/\1/g'`
clear
MAIL_BODY=`echo "Su saldo Sr. Señor: ${SALDO} euros" > /tmp/mail.body`
mail email@domain.com -s "Saldo Tarjeta Restaurant: ${SALDO} euros" < /dev/null</pre>
<p>Sigue leyendo para conocer la explicación</p>
<p><span id="more-518"></span></p>
<p style="text-align: left;">La página en cuestión puede verse a través del enlace de la imagen:</p>
<p style="text-align: center;"><a rel="rokbox[65% 80%]"  href="https://ticketrestaurant.geanetondemand.com/TRC/index.html"><img class="rokbox-thumb" src="http://www.tux-es.com/project1/wp-content/uploads/2009/11/www.jpg" alt="" /></a></p>
<p style="text-align: left;">Antes de nada, comentaremos las herramientas que hemos utilizado para elaborarlo.</p>
<ul class="special-14">
<li><a href="http://www.mozilla-europe.org/es/firefox/" target="_blank">Firefox 3.0</a></li>
<li><a href="http://livehttpheaders.mozdev.org/" target="_blank">Addon de Firefox</a></li>
</ul>
<p style="text-align: left;">Estas herramientas nos permiten identificar los elementos iniciales: url de inicio, url de login, campos de formulario y dirección del POST. Es importante obtener todos los campos de tipo hidden para lanzar el POST.</p>
<p style="text-align: left;">Con la variable AGENT simulamos un navegador de usuario, aquí dejo otros ejemplos válidos:</p>
<pre>Mozilla/3.0 (compatible; HandHTTP 1.1)
Mozilla/4.0 (compatible; MSIE 4.01; Windows NT Windows CE)
Mozilla/2.0 (compatible; MSIE 3.02; Windows CE; 240x320)
Mozilla/1.22 (compatible; MMEF20; Cellphone; Sony CMD-Z5)
Nokia-Communicator-WWW-Browser/2.0 (Geos 3.0 Nokia-9000i)
Nokia-Communicator-WWW-Browser/3.0 (Geos 3.0 Nokia-9110)
Mozilla/4.51 (compatible; Opera 3.62; EPOC; 640x240)
Palmscape/PR5 (PalmPilot Pro; I)
Mozilla/5.001 (windows; U; NT4.0; en-us) Gecko/25250101
Mozilla/5.001 (Macintosh; N; PPC; ja) Gecko/25250101 MegaCorpBrowser/1.0 (MegaCorp, Inc.)
Mozilla/9.876 (X11; U; Linux 2.2.12-20 i686, en) Gecko/25250101 Netscape/5.432b1 (C-MindSpring)
TinyBrowser/2.0 (TinyBrowser Comment) Gecko/20201231
Mozilla/5.0 (compatible; Konqueror/3.4; Linux 2.6.10-5-386; X11; i686; es, en_US) KHTML/3.4.0 (like Gecko)
Microsoft Internet Explorer/4.0b1 (Windows 95)
Mozilla/1.22 (compatible; MSIE 1.5; Windows NT)
Mozilla/1.22 (compatible; MSIE 2.0; Windows 95)
Mozilla/2.0 (compatible; MSIE 3.01; Windows 98)
Mozilla/4.0 (compatible; MSIE 5.0; SunOS 5.9 sun4u; X11)
Mozilla/4.0 (compatible; MSIE 5.23; Mac_PowerPC)
Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
Mozilla/4.0 (compatible; MSIE 6.0; MSN 2.5; Windows 98)
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322)
Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 5.1)
Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0)
Mozilla/1.1 (compatible; MSPIE 2.0; Windows CE)
Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; PPC; 240x320)
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)
Mozilla/5.0 (compatible; Konqueror/3.1-rc3; i686 Linux; 20020515)
Mozilla/5.0 (compatible; Konqueror/3.1; Linux 2.4.22-10mdk; X11; i686; fr, fr_FR)
Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050511
Mozilla/5.0 (X11; U; Linux i686; cs-CZ; rv:1.7.12) Gecko/20050929
Mozilla/5.0 (Windows; U; Windows NT 5.1; nl-NL; rv:1.7.5) Gecko/20041202 Firefox/1.0
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.6) Gecko/20050512 Firefox
Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.8) Gecko/20050609 Firefox/1.0.4
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6
Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-GB; rv:1.7.10) Gecko/20050717 Firefox/1.0.6
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7
Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050908 Firefox/1.4
Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8b4) Gecko/20050908 Firefox/1.4
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a1) Gecko/20051019 SeaMonkey/1.1a
Mozilla/3.0 (X11; I; SunOS 5.4 sun4m)
Mozilla/4.61 (Macintosh; I; PPC)
Mozilla/4.61 [en] (OS/2; U)
Mozilla/4.7C-CCK-MCD {C-UDP; EBM-APPLE} (Macintosh; I; PPC)
Mozilla/4.8 [en] (Windows NT 5.0; U)
Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.0.1) Gecko/20020920 Netscape/7.0
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20050519 Netscape/8.0.1
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50215) Netscape/8.0.1
Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.51
Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57
Mozilla/4.0 (compatible; MSIE 5.0; Windows 2000) Opera 6.03 [en]
Nokia9500/7.23 (Windows 98; U) [en]
Opera/8.00 (Windows NT 5.1; U; en)
Opera/8.0 (X11; Linux i686; U; cs)
Opera/8.02 (Windows NT 5.1; U; en)
Opera/8.50 (Windows NT 5.1; U; en)
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 8.50
Mozilla/5.0 (Windows NT 5.1; U; en) Opera 8.50
Opera/8.5 (X11; Linux i686; U; cs)
Opera/9.0 (Windows NT 5.0; U; en)
Mozilla/4.0 (PSP (PlayStation Portable); 2.00)
Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/124 (KHTML, like Gecko) Safari/125
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2)
Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312
Mozilla/5.0 (Macintosh; U; PPC Mac OS X; it-it) AppleWebKit/412 (KHTML, like Gecko) Safari/412
ELinks (0.4pre5; Linux 2.4.27 i686; 80x25)
Links (0.99pre14; CYGWIN_NT-5.0 1.5.16(0.128/4/2) i686; 80x25)
Links (2.1pre17; Linux 2.6.11-gentoo-r8 i686; 80x24)
Lynx/2.8.4rel.1 libwww-FM/2.14
Mozilla/4.7 (compatible; OffByOne; Windows 2000</pre>
<p style="text-align: left;">En sucesivos script iremos explicando el resto de comandos.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tux-es.com/project1/2009/11/script-consulta-de-saldo-de-tarjeta-restaurant/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Shell script: leer cada línea de un fichero</title>
		<link>http://www.tux-es.com/project1/2009/11/shell-script-leer-cada-linea-de-un-fichero/</link>
		<comments>http://www.tux-es.com/project1/2009/11/shell-script-leer-cada-linea-de-un-fichero/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 09:48:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[/dev/random]]></category>
		<category><![CDATA[shell script]]></category>

		<guid isPermaLink="false">http://www.tux-es.com/project1/?p=459</guid>
		<description><![CDATA[
#!/bin/bash

exec 0&#60; fichero1
while read -r LINEA
do
echo $LINEA
done

]]></description>
			<content:encoded><![CDATA[<pre>
#!/bin/bash

exec 0&lt; fichero1
while read -r LINEA
do
echo $LINEA
done
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.tux-es.com/project1/2009/11/shell-script-leer-cada-linea-de-un-fichero/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
