|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
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. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
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 |
|
![]() |
| Outils de la discussion | |
|
|