[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [TEKNIK] Shell script større end og mindre ind



Jeg er ikke sikker på, at jeg forstår spm. Men har du kigget på -ne og
-gt mm.: http://www.tldp.org/LDP/abs/html/comparison-ops.html

ala.

if [ "$a" -ge "$b"  and "$a" -ge "$b" ]; then
 echo "foo"
fi

Nils

30. jul. 2008 08.47 skrev mikkel meinike <sslug@sslug>:
> HEJ
> Kan man i et bash shell script lave en conditional expression som i en og
> samme  expression tester om en variable er større end og mindre end. F. eks.
> Større end 25 og mindre end 50. Hvis ja er der ikke nogen som vil skrive
> denne test expression for mig så jeg kan få syntaksen. Tillægsspørgsmål mest
> for forståelsens skyld. Jeg har læst om case kommandoen i shell script hvor
> man kan teste f. eks. en variable og så have flere forskellige mulige forløb
> alt afhængigt af hvilket resultat testen giver. Jeg tænker om man ikke kunne
> gøre presist det samme ved at have en række "if than fi" efter hinanden. Som
> tester og har forskellig udfald for de forskellige test resultater. Jeg ved
> ikke om mit spørgsmål er til at fatte men hvis der er kunne i måske forklare
> mig hvorfor man evt. ikke skulle kunne gøre det med en række "if than fi"
> /mikkel
>
>
>
>



-- 
Nils


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2008-08-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *