Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google site



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Closed Thread
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-30-2007
Registered User
 

Join Date: Sep 2007
Location: AIX-VILLE
Posts: 88
Little Trouble Understanding some code...

Couple of questions as I try to decipher someones code who left...

What would something coded like this do?

IFS=:
grep FIELD1 /Path/Path2/Param.fle | read LBL1 LBL2 USRID EADR SUBJ SERVERNAME CFGTBL DIR
ERR=0

Param.fle contents..
FIELD1:FEI::FIELD2:dATAFIELD BATCH:MAIN SERVER......etc..
Sponsored Links
  #2 (permalink)  
Old 10-30-2007
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 6,172
IFS=: makes a colon the default field separator. By grep FIELD1, the code only finds records with the word "FIELD1" in them, probably just one record.

Next, since IFS is a colon, each of the variables in the read statement will be assigned the value of the corresponding field in the file.
LBL1 will be the first field, ie., FIELD1
LBL2 will be the second FEI
and so on.

You now have several variables defined as the contents of the fields in one record from
Param.fle
  #3 (permalink)  
Old 10-31-2007
Registered User
 

Join Date: Sep 2007
Location: AIX-VILLE
Posts: 88
I got you up to LBL2, so then USRID is going to be blank because of the '::' after FEI which if I'm understanding correctly is null since there is nothing in between the colons?
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how i prepare a c++ code(c code) for implementing my own protocol format amitpansuria Programming 1 09-07-2007 12:09 AM
Understanding this Makefile the_learner Programming 5 06-14-2007 02:55 AM
Understanding traceroutes Bobby IP Networking 2 03-14-2005 05:35 PM
need further understanding of init.d jigarlakhani UNIX for Advanced & Expert Users 1 09-20-2002 04:11 PM



All times are GMT -4. The time now is 06:08 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2010. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0