![]() |
| ||
| Re: Unixx shel script - combing information from 2 files into one useing looping structur can u explain this code please. |
| ||
| Re: Unixx shel script - combing information from 2 files into one useing looping structur while read -r name number Basically, this pseudo code is reading the first file and grabbing the two variables, and for each line read from the first file, it's checking every line in the second file and, if the name matches, it's print the output in the format you specified to stdout. If you need Monday to equal Mon, etc, you can do that pretty easily with sed or even cut, if you know you only need a certain number of characters in your abbreviation (like if your standard is always 3 - Monday = Mon, Tuesday = Tue, etc) Hope that helps. Give it a shot and see what you can do with it. Remember, the code posted is pseudo-code which means it's not entirely "correct" (won't just work if you cut-and-paste it) and is meant to demonstrate a principal and provide a means to reaching the answer rather than being the answer itself. Best wishes, , Mike |
| ||
| Re: Unixx shel script - combing information from 2 files into one useing looping structur BTW, Just a friendly tip. You might want to kill the other 3 or 4 identical posts you have in this forum or an admin might delete them all. Just trying to help out so you don't get bumped off. Hope you get your problem solved soon :) , Mike |
| ||
| Re: Unixx shel script - combing information from 2 files into one useing looping structur I wished I had seen this post earlier. Cause I had the same home work in my unix class. It took me a good while, but I got it working with the for loop. Anywho, happy scripting!... |
| All times are GMT -4. The time now is 6:23 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC