PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.unix.shell > if [ $row > 0 ]; then : ; else.... What that means?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.unix.shell Using and programming the Unix shell.

if [ $row > 0 ]; then : ; else.... What that means?

Réponse
 
LinkBack Outils de la discussion
Vieux 26/04/2007, 19h22   #1
lazyboy_2k@yahoo.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut if [ $row > 0 ]; then : ; else.... What that means?

Hi,

I'm looking at a internal script & see this below if statement but I
don't understand it. Could someone please explain what it means if
you don't mind?

#!/bin/ksh

row=0
if [ $row > 0 ]
then
: # note I don't understand what " : " notation
actually does & means
else
........
fi

TIA,
-Chris

  Réponse avec citation
Vieux 26/04/2007, 20h39   #2
Bill Marcum
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: if [ $row > 0 ]; then : ; else.... What that means?

On 26 Apr 2007 10:22:16 -0700, lazyboy_2k@yahoo.com
<lazyboy_2k@yahoo.com> wrote:
>
>
> Hi,
>
> I'm looking at a internal script & see this below if statement but I
> don't understand it. Could someone please explain what it means if
> you don't mind?
>
> #!/bin/ksh
>
> row=0
> if [ $row > 0 ]
> then
> : # note I don't understand what " : " notation
> actually does & means

: means "do nothing".


--
<Deek> Yes, America is a country based on how pissed-off a group of taxed
people can get.
<Deek> We exist as a country because we're cheap.
  Réponse avec citation
Vieux 26/04/2007, 21h10   #3
Warren Block
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: if [ $row > 0 ]; then : ; else.... What that means?

Bill Marcum <marcumbill@bellsouth.net> wrote:
> On 26 Apr 2007 10:22:16 -0700, lazyboy_2k@yahoo.com
> <lazyboy_2k@yahoo.com> wrote:
>>
>>
>> Hi,
>>
>> I'm looking at a internal script & see this below if statement but I
>> don't understand it. Could someone please explain what it means if
>> you don't mind?
>>
>> #!/bin/ksh
>>
>> row=0
>> if [ $row > 0 ]
>> then
>> : # note I don't understand what " : " notation
>> actually does & means

> : means "do nothing".


Likewise with row=0 followed by 'if [ $row > 0 ]'.

--
Warren Block * Rapid City, South Dakota * USA
  Réponse avec citation
Vieux 27/04/2007, 09h42   #4
Stephane CHAZELAS
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: if [ $row > 0 ]; then : ; else.... What that means?

2007-04-26, 19:10(-00), Warren Block:
[...]
>> : means "do nothing".

>
> Likewise with row=0 followed by 'if [ $row > 0 ]'.


No

[ 0 > 0 ], or [ 0 ] > 0, or [ > 0 0 ] (the redirection may be
anywhere on the line, it doesn't make any difference, tests
whether you can truncate the file called "0" in the current
directory.

--
Stéphane
  Réponse avec citation
Vieux 27/04/2007, 19h12   #5
Warren Block
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: if [ $row > 0 ]; then : ; else.... What that means?

Stephane CHAZELAS <this.address@is.invalid> wrote:
> 2007-04-26, 19:10(-00), Warren Block:
> [...]
>>> : means "do nothing".

>>
>> Likewise with row=0 followed by 'if [ $row > 0 ]'.

>
> No
>
> [ 0 > 0 ], or [ 0 ] > 0, or [ > 0 0 ] (the redirection may be
> anywhere on the line, it doesn't make any difference, tests
> whether you can truncate the file called "0" in the current
> directory.


You're right. I wonder if the author of the script realized that.

--
Warren Block * Rapid City, South Dakota * USA
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 22h55.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09095 seconds with 13 queries