🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Instruccion IF en BASH

#6587
From: Fernando Arbeiza
Date: Fri, 06 Jun 2003 16:36
19 lines
1590 bytes
On Fri, 6 Jun 2003 18:21:07 +0000, Bypper <bypper@tomate.fadlan.com> wrote:
> if [ $VARIABLE -eq 4 and $VARIABLE -eq 1 ]; then
> 	loquesea
> fi

Bash te permite hacerlo sin la sintaxis de test (tan fea, por cierto):

if (((VARIABLE == 4) && (VARIABLE == 1))); then
    loquesea
fi

Lo que me recuerda mucho a C ;-) Ah, tanto par�ntesis _no_ es opcional;
lee la p�gina man de bash, sobre todo la secci�n de *�rdenes compuestas*
y la de *Evaluaci�n aritm�tica*.

Un saludo.
-- 
Fernando Arbeiza        <URL: mailto:arbeizaf@ono.com>
Crea tu propio Linux:   <URL: http://www.escomposlinux.org/lfs-es>
Technical Details
Message-ID: <slrnbe1goc.9ct.arbeizaf@jupiter.olimpo.homelinux.org>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.vmunix.org!fu-berlin.de!uni-berlin.de!81-203-248-186.user.ono.COM!not-for-mail
References: <20030606182107.3a4e80f9.bypper@tomate.fadlan.com>

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: f86c8,a4f2f52955aaa8ff
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2003-06-06 09:43:31 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.vmunix.org!fu-berlin.de!uni-berlin.de!81-203-248-186.user.ono.COM!not-for-mail
From: Fernando Arbeiza <arbeizaf@ono.com>
Newsgroups: es.comp.os.linux.programacion
Subject: Re: Instruccion IF en BASH
Date: Fri, 6 Jun 2003 18:36:28 +0200
Lines: 19
Message-ID: <slrnbe1goc.9ct.arbeizaf@jupiter.olimpo.homelinux.org>
References: <20030606182107.3a4e80f9.bypper@tomate.fadlan.com>
NNTP-Posting-Host: 81-203-248-186.user.ono.com (81.203.248.186)
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-15
Content-Transfer-Encoding: 8bit
X-Trace: fu-berlin.de 1054917810 12071280 81.203.248.186 (16 [148301])
X-Orig-Path: jupiter.olimpo.homelinux.org!news
User-Agent: slrn/0.9.7.4 (Linux)