Mailinglist Archive: opensuse (1483 mails)

< Previous Next >
Re: the cut command was:[opensuse] grep sed and awk question
  • From: Anders Johansson <ajh@xxxxxxxx>
  • Date: Wed, 15 Feb 2012 01:03:56 +0100
  • Message-id: <8109397.CNuvaEpyyi@carolin>
On Wednesday 15 February 2012 01:00:38 lynn wrote:
strsid="S-1-5-21-2395500911-3560017633-4088823418-1134"
pgrp=$(echo $strsid | cut -d "-" -f 8)

$pgrp=1134
I count 7 - delimiters
I don't understand any more.

What's the -f n saying? 'I go to the n-1'th delimiter and give you
whatever is between that and the n'th delimiter'?

Can I assume that the n'th delimiter could either be a delimiter or an
end of line character? If so, what is the end of line delimiter?

-f means "field". S is the first field, 1 the second, 21 the third, and so on.
1134 is the 8th field.

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

< Previous Next >
Follow Ups
References