While loop wired output issue


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting While loop wired output issue
# 1  
Old 07-13-2012
While loop wired output issue

Hi,

Wired output I am getting. Pls let me know what mistake i did on below loop script

Code:
paste profile.txt names.txt | while read i j
 
do
 
 echo [Profile$i] >> profiles.ini
 echo Name=$j >> profiles.ini
 echo IsRelative=1 >> profiles.ini
 echo Path=Profiles/$j >> profiles.ini
 
done

Output. But i need only upto Path=Profiles/test2 why it is printing more
HTML Code:
[Profile3]
Name=test1
IsRelative=1
Path=Profiles/test1
[Profile4]
Name=test2
IsRelative=1
Path=Profiles/test2
[Profile]
Name=
IsRelative=1
Path=Profiles/
[Profile]
Name=
IsRelative=1
Path=Profiles/
[Profile]
Name=
IsRelative=1
Path=Profiles/
[Profile]
Name=
IsRelative=1
Path=Profiles/
[Profile]
Name=
IsRelative=1
Path=Profiles/
[Profile]
Name=
IsRelative=1
Path=Profiles/
[Profile]
Name=
IsRelative=1
Path=Profiles/
[Profile]
Name=
IsRelative=1
Path=Profiles/
[Profile]
Name=
IsRelative=1
Path=Profiles/
[Profile]
Name=
IsRelative=1
Path=Profiles/
[Profile]
Name=
IsRelative=1
Path=Profiles/
[Profile]
Name=
IsRelative=1
Path=Profiles/
[Profile]
Name=
IsRelative=1
Path=Profiles/
[Profile]
Name=
IsRelative=1
Path=Profiles/
[Profile]
Name=
IsRelative=1
Path=Profiles/
# 2  
Old 07-13-2012
Hi

Little tough to say without having to look at the contents of files profile.txt and names.txt. However, it looks like the files have quite a few blank lines and hence the extended output. If so, removing the blank lines should do.

Guru
# 3  
Old 07-13-2012
I am guessing, one of the input files has a lot of empty lines at the end?
# 4  
Old 07-13-2012
Thanks

yes issue resolved. I have empty lines at the end?
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Issue with while loop?

Hi, I have prepared a script to search for backup file information on the Linux server. Script works fine for the most part except the echo statement inside an IF conditional block displays the message ''snapshot directory not found on xxxxx" even though the .snapshot directory is found a... (11 Replies)
Discussion started by: svajhala
11 Replies

2. Red Hat

hostapd & wired network ?

hi im using the following network with hostapd on the authenticator : Authentication server <---wired---> Authenticator(hostapd<----wired---> User (win XP with WinRadius) 1.100 -------- 1.200 , 0.13 ----- 0.12 and this is my configurations for hostapd : interface=eth1 driver=wired... (0 Replies)
Discussion started by: turner
0 Replies

3. Programming

wired problem about next_permutation

hello all, If i have a vector of strings,i wanna get all possible combinations of them,for example,the elements of that vector are "hello" "world" "!" I thought the answer should be: hello world ! hello ! world world ! hello world hello ! ! hello world ! world hello However,with... (2 Replies)
Discussion started by: homeboy
2 Replies

4. What is on Your Mind?

Wired keyboard sniffing

Are we safe using the everyday wired keyboard? Although this concept is old, I had never seen an actual implementation on the matter until a few days ago. (Four ways of sniffing the electromagnetic emanations of wired keyboards currently on the market in up to 20 meters.) Check the videos at:... (2 Replies)
Discussion started by: redoubtable
2 Replies

5. Shell Programming and Scripting

while loop issue

Hi, Following is my code and the file FILE_LIST_EXCESS.txt has 40 file names in it while read LineIn do echo ${LineIn} `ftp -vin << END_INPUT >> ${PID}_DS_GET_Log.log 2>&1 open servername user userid password cd FileDir get ${LineIn} END_INPUT`... (4 Replies)
Discussion started by: mgirinath
4 Replies

6. UNIX for Advanced & Expert Users

wired pages

hi, can any body tell, what are wired pages in HP_UX. which structure contains that and plz tell the corresponding system call to get it. (1 Reply)
Discussion started by: venkat_t
1 Replies

7. Programming

wired and inactive pages

Hello How to find out wired pages and inactive pages in HP -UNIX. Bye (1 Reply)
Discussion started by: manjunath
1 Replies
Login or Register to Ask a Question

Featured Tech Videos