🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #12225

Re: Bash

#12225
From: Francisco F. Artese
Date: Thu, 16 Aug 2001 21:38
60 lines
2533 bytes
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Claudio S. Suarez <claudio@ningun.sitio.es> escribi�:


> No necesitas conversi�n. Puedes hacer:
> pepe="12"
> juan=`grep connect /var/log/messages | cut -f4`
> a=`expr $pepe + $juan`

> Y funcionar�. Incluso puedes usar $((   ))

> a=$(( $pepe + $juan ))

>>y formar un n�mero hc=horac*60+minutosc+segundosc/60

> hc=$(( $horac * 60 + $minutosc + $segundosc / 60 ))


Lamento decirte que no me funciona:

- ----------------------------------------------------
#!/bin/bash

horac=echo "date" | cut -f4 -d" " | cut -f1 -d":"
minutosc=echo "date" | cut -f4 -d" " | cut -f2 -d":"
segundosc=echo "date" | cut -f4 -d" " | cut -f3 -d":"

hc=$(( $horac * 60 + $minutosc + $segundosc / 60 ))

echo $hc
- -----------------------------------------------------


frank@artese:~/bin$ tiempo

/home/frank/bin/tiempo: * 60 +  +  / 60 : syntax error: operand expected
(error
token is "* 60 +  +  / 60 ")

Me tiene loco esto...........

Saludos

- -- 
 "He instalado el Windows ME y me va sin problemas." (Pinocho)
==============================================================
   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

iD8DBQE7fD1akdq1r8MtrroRAgrpAKCP7a0evuBkW6jeMdJ6aedvSu8J/QCgli0q
3U59ZRCCtrZmEJqgC5UOTNo=
=hoIw
-----END PGP SIGNATURE-----
Technical Details
Message-ID: <rgehl9.4u3.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!200.68.207.66!not-for-mail
References: <hj97l9.p7j.ln@127.0.0.1> <slrn9nj7i2.b7.claudio@cacho.celta>

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: f86c8,9df979b8f9cb249b
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2001-08-16 14:43:11 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!200.68.207.66!not-for-mail
From: "Francisco F. Artese" <frank@artese.com.ar>
Newsgroups: es.comp.os.linux.programacion
Subject: Re: Bash
Date: Thu, 16 Aug 2001 18:38:35 -0300
Lines: 60
Message-ID: <rgehl9.4u3.ln@127.0.0.1>
References: <hj97l9.p7j.ln@127.0.0.1> <slrn9nj7i2.b7.claudio@cacho.celta>
NNTP-Posting-Host: 200.68.207.66
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: fu-berlin.de 997998190 9927682 200.68.207.66 (16 [42069])
X-Orig-Path: not-for-mail
User-Agent: tin/1.5.8-20010221 ("Blue Water") (UNIX) (Linux/2.2.17 (i686))