![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 !! |
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 | High Level Programming | 1 | 09-06-2007 11:09 PM |
| Understanding this Makefile | the_learner | High Level Programming | 5 | 06-14-2007 01: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 03:11 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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.. |
|
||||
|
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 |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|