🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Tratar variables numericas en bash

#8102
From: garlito
Date: Thu, 12 Dec 2002 22:41
16 lines
1396 bytes
Edgar de la cruz escribi�:

> NUMERIC=0
> for i in ls *.mp3
> do
>         NUMERIC=$NUMERIC+1

Aqu� tienes que poner NUMERIC=$((1 + NUMERIC))
o bien lo mismo que tienes pero declarando la variable como entera al
principio: declare -i NUMERIC=0

> done
> 
> echo $NUMERIC

Saludos
Technical Details
Message-ID: <8b3bta.me.ln@127.0.0.1>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!syros.belnet.be!news.belnet.be!newsfeed.wxs.nl!amsnews01.chello.com!news-hub.cableinet.net!blueyonder!marmolejo.escomposlinux.org!frodo.antakira.com!pinsa.escomposlinux.org!127.0.0.1!nobody
References: <ata5pc$mh9$1@julieta.escomposlinux.org>

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: f86c8,b6beb247a4710747
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2002-12-12 12:30:09 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!syros.belnet.be!news.belnet.be!newsfeed.wxs.nl!amsnews01.chello.com!news-hub.cableinet.net!blueyonder!marmolejo.escomposlinux.org!frodo.antakira.com!pinsa.escomposlinux.org!127.0.0.1!nobody
From: garlito <garlito@wanadoo.es>
Newsgroups: es.comp.os.linux.programacion
Subject: Re: Tratar variables numericas en bash
Date: Thu, 12 Dec 2002 23:41:44 +0100
Organization: Ecolnet
Lines: 16
Message-ID: <8b3bta.me.ln@127.0.0.1>
References: <ata5pc$mh9$1@julieta.escomposlinux.org>
NNTP-Posting-Host: 62-37-138-236.dialup.uni2.es
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: pinsa.escomposlinux.org 1039725009 24890 62.37.138.236 (12 Dec 2002 20:30:09 GMT)
X-Complaints-To: newsmaster@pinsa.escomposlinux.org
NNTP-Posting-Date: Thu, 12 Dec 2002 20:30:09 +0000 (UTC)
User-Agent: slrn/0.9.7.4 (Linux)