LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-09-2012, 12:14 PM   #16
Alchemikos
Member
 
Registered: Jun 2012
Location: Porto Alegre-Brazil
Distribution: Slackware- 14, Debian Wheezy, Ubuntu Studio, Tails
Posts: 88

Rep: Reputation: 6

Hello

I think it works:

Code:
f1="london 1 1"                                                                                                                                                                    
a=1                                                                                                       
while read line                                                                                           
do 
    echo  "$f1"    >> "S$a"                                                                                                                                                                                         
    echo   "$line" >> "S$a"                                                                                     
    ((a++))                                                                                              
done < f2
Cheers
 
1 members found this post helpful.
Old 07-09-2012, 12:54 PM   #17
iconig
LQ Newbie
 
Registered: May 2012
Posts: 28

Original Poster
Rep: Reputation: Disabled
Yes it does work, I checked it again. Thanks all
 
Old 07-09-2012, 02:15 PM   #18
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Have another look at my code and try to spot the difference
 
Old 07-09-2012, 02:42 PM   #19
iconig
LQ Newbie
 
Registered: May 2012
Posts: 28

Original Poster
Rep: Reputation: Disabled
Just a slight difference between your code and Alchemikos. But it is essentially your code. I used the two and both worked for me. The fault was from me. Thanks again. The best
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to check missing header files included from another header file adisan82 Linux - Software 1 01-28-2011 03:57 AM
[exim4] Remove header lines matching received client ip konddor Debian 1 10-23-2009 03:25 AM
Count commas in header and append as many missing from the lines underneath tribal_molecule Programming 1 08-12-2009 06:05 AM
Need help appending text to lines in a file using vi editor tmbrwolf53 Linux - Newbie 3 10-31-2008 03:25 PM
Appending ends of lines in sed Agentrooker Programming 8 08-07-2008 11:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration