Mailinglist Archive: opensuse (686 mails)

< Previous Next >
Re: [opensuse] shell script help
  • From: Per Jessen <per@xxxxxxxxxxxx>
  • Date: Mon, 08 Jul 2013 16:54:21 +0200
  • Message-id: <krejr7$s1p$>
Felix Miata wrote:

On 2013-07-08 08:29 (GMT-0400) Anton Aylward composed:

Felix Miata wrote:

I don't
understand why -d: -f2 works. The -d: part I sort of get, but not
why 2 and not 1 after -f.

Because you want the second field.

Of course that's what a 2 would mean, but....

it goes <field> <delimiter> <field> [ <delimiter> <field> .... }

so you have

hostname : 0.0
field delimiter field

field #1 is the hostname
field #2 is the screen number

The real question is "Why is this not zero indexed?"

Why should anything humans use be zero indexed? The first thing we
count is the first thing we count, 1, not zero. Zero means zilch,
nothing, nada, less than one thing.

The real question is what does hostname have to do with anything (aka
how does :0 get to be a second field):

# echo $DISPLAY

When the field delimiter is ':', the first field (hostname) is empty,
the second is '0'.

Per Jessen, Zürich (25.8°C) - free DNS hosting, made in Switzerland.

To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >