Re: stupid shell tricks again

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: ec
Date:  
To: plug-discuss
Subject: Re: stupid shell tricks again

--- Craig White <> wrote:
> On Mon, 2004-03-22 at 17:45, Bill Jonas wrote:
> > On Mon, Mar 22, 2004 at 05:29:35PM -0700, Craig
> White wrote:
> > > I will be dammed but I can't make the line above
> this one work...this is
> > > where the problem is...
> > > i=`echo $line | cut -f1`;
> >
> > Try:
> > i=`echo $line | cut -d' ' -f1`;
> > instead.
> ----
> yup that did it
>
> this is too hard for me ;-)
>
> Craig
> \


The part... -d' ' -f1 set the delimiter to the first
field.. per my unix1 class just a couple hours ago!
The space between the two ' ' sets the delimiter to
the space bar or white space in the output of $line
(if I understood Gerald, my instructor correctly.

Excerpt from the 'class' Here, we needed the
':' or colon delimiter, but you need the ' ' white
space delimiter

$ cut -f1 -d":" /etc/passwd | and on to another stdin


      The 'cut' command prints the values of field
      one found in the /etc/passwd file having colon
      delimited fields. 


He wrote one in the class as an example and used the
white space delimiter.

Hope that explains that/helped!!!

=====
Cyclists should expect and demand safe
accommodation on our public roads,
just as does every other user.

Nothing more is expected.

Nothing less is acceptable!

__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss