Article View: es.comp.os.linux.programacion
Article #12194Bash
From: Francisco F. Artese
Date: Mon, 13 Aug 2001 01:13
Date: Mon, 13 Aug 2001 01:13
56 lines
2544 bytes
2544 bytes
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hola amigos
En bash como transformo una variable de tipo $pepe para que sea una
expresi�n num�rica????????
de manera que pueda hacer:
a=`expr $pepe + $juan`
Es que quiero hacer un script para medir el tiempo de conexi�n de ppp0 y
se me ocurrio usar esto:
#!/bin/bash
horac=`echo "registro de syslog up" | cut -f4 -d" " | cut -f1 -d":"`
minutosc=`echo "registro de syslog up" | cut -f4 -d" " | cut -f2 -d":"`
segundosc=`echo "registro de syslog up" | cut -f4 -d" " | cut -f3 -d":"`
y formar un n�mero hc=horac*60+minutosc+segundosc/60
horad=`echo "registro de syslog down" | cut -f4 -d" " | cut -f1 -d":"`
minutosd=`echo "registro de syslog down" | cut -f4 -d" " | cut -f2 -d":"`
segundosd=`echo "registro de syslog down" | cut -f4 -d" " | cut -f3 -d":"`
y formar otro n�mero hd=horad*60+minutosd+segundosd/60
Luego
Tiempo en minutos de conexi�n =hd-hc
Mi problema consiste en manipular como expresiones num�ricas a horad,
minutosd, etc, obtenidos mediante cut.
Gracias mil
Saludos
- --
Si algo puede fallar, fallar� (Murphy).
==============================================================
Francisco F. Artese - Linux user #174223 - ICQ #17693614
Linux Debian Potato 2.2 and IceWM 1.0.3
LAS MALVINAS SON ARGENTINAS!
==============================================================
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE7dymwkdq1r8MtrroRAjxsAJwPZ7MjeBH6HJDVEA3dd/3ZMQR/EQCeMlvf
JVs6xSCEeuzy324HpjaL2Jg=
=MuCL
-----END PGP SIGNATURE-----
Technical Details
Message-ID:
<hj97l9.p7j.ln@127.0.0.1>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!130.133.1.3!fu-berlin.de!uni-berlin.de!ppp-199-67.movi.com.AR!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: f86c8,9df979b8f9cb249b,start
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2001-08-12 18:14:42 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!130.133.1.3!fu-berlin.de!uni-berlin.de!ppp-199-67.movi.com.AR!not-for-mail
From: "Francisco F. Artese" <frank@artese.com.ar>
Newsgroups: es.comp.os.linux.programacion
Subject: Bash
Date: Sun, 12 Aug 2001 22:13:21 -0300
Lines: 56
Message-ID: <hj97l9.p7j.ln@127.0.0.1>
NNTP-Posting-Host: ppp-199-67.movi.com.ar (200.49.199.67)
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: fu-berlin.de 997665279 8465034 200.49.199.67 (16 [42069])
X-Orig-Path: not-for-mail
User-Agent: tin/1.5.8-20010221 ("Blue Water") (UNIX) (Linux/2.2.17 (i686))