Shell script problem


Login or Register for Dates, Times and to Reply

 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell script problem
# 1  
Shell script problem

I have two files.

file 1 content is
Code:
jerry 123
tom 456
shrek 789

file 2 contents is
Now, i want output this format
Code:
jerry 123 a@hotmail.com
jerry 123 b@hotmail.com
tom  456 c@hotmail.com
tom  456 d@hotmail.com
sherk 789 e@hotmail.com
sherk 789 f@hotmail.com

Please,help me thank a lot .

Last edited by Franklin52; 03-11-2012 at 08:06 AM.. Reason: Please use code tags for data and code samples, thank you
# 2  
Hi, try:
Code:
awk 'NR%2{getline p<f}{print p OFS $1}' f=file1 file2

This User Gave Thanks to Scrutinizer For This Post:
# 3  
thanks Scrutinizer , good reasoning.
Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #20
Difficulty: Medium
India's first Super Computer, the PARAM 8000, was installed in 1991.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script newbie, what is problem with my script?

Hello, Ubuntu server 11.10 can anybody help what is problem with my shell script? #!/bin/bash #script to find out currently logged on user is root or not. if ] then echo "You are super" else echo "You are awesome!" fi When I run script, I get following output ./uid: line 3: I... (4 Replies)
Discussion started by: kaustubh
4 Replies

2. Shell Programming and Scripting

Problem in shell script

hi...i create a script which reads data from file and compare that the data which is entered by me through keyboard...i can easily read first two contents of file..i am facing the problem to read other contents.. structure of my file is username:password:username1:password1.......and so on ... (1 Reply)
Discussion started by: shubhig15
1 Replies

3. AIX

There's problem with shell script...Help me~

Hello, guys... I'm new to IBM AIX server admin. Actuall, I administrate Oracle 10g on it. *SYSTEM INFO - IBM AIX 6 Powerpc - Oracle 10g R2 (10.2.0.4.0 - 64bit) I wrote a script like bellow... DATE='date' cp /oracle/product/10g/network/log/listener_temp.log... (4 Replies)
Discussion started by: daniel han
4 Replies

4. UNIX for Dummies Questions & Answers

Problem with Shell Script

Hi, I have a line in my script: fgrep "BancoPosta" /var/spool/postfix/deferred/*/* > /root/spulk.italiantmp1 It does NOT seem to excute. But when I run it on command line it does. Any ideas how to fix the problem? (1 Reply)
Discussion started by: mojoman
1 Replies

5. Shell Programming and Scripting

shell script , $$ problem

dialog --title "Inputbox - To take input from you" --backtitle "Linux Shell\ Script Tutorial" --inputbox "Enter your name please" 8 60 2>/tmp/input.$$ sel=$? na=`cat /tmp/input.$$` case $sel in 0) echo "Hello $na" ;; 1) echo "Cancel is Press" ;; 255) echo " key pressed" ;; ... (7 Replies)
Discussion started by: cola
7 Replies

6. Shell Programming and Scripting

call shell script from perl cgi script problem

hi,, i have perl scipt with line : system('./try.sh $t $d $m'); in shell scipt try.sh i have the line: echo $1 its not printing value of $t that i hav passed..y is it so..i am running it from apache web server (2 Replies)
Discussion started by: raksha.s
2 Replies

7. Shell Programming and Scripting

shell script problem

I have one file list.fdict which contains recordname and its details. like : NAME1:25:C:NAME LINE1: NAME2:25:C:NAME LINE2: CITY:25:C:City: STATE:2:C:State: ZIPCODE:5:N:ZIPCODE: PHONE1:12:C:HOME PHONE: PHONE2:12:C:BUSINESS PHONE: I want to append news records(22 different records line)... (3 Replies)
Discussion started by: amitpansuria
3 Replies

8. Shell Programming and Scripting

Problem in shell script

:confused: Hi, I have written a script which calls a stored procrdure. The Stored procedure has 2 inputs and 6 outputs. I need to capture one of the outputs. But I am not able to get any result from this simple script- ! /bin/ksh echo "connect to dbau user etlbitst using anf1892;" >... (1 Reply)
Discussion started by: arnie_nits
1 Replies

9. Shell Programming and Scripting

Help! Problem with Shell Script.

hi! i have the script which i hit error. anyone knows whats wrong? i have been trying for the last 3 days and don't seems to be able to find an answer. the error i got was sp_out.sh: syntax error at line 51 : `<<' unmatched. However when i move the FTP portion of the script out of the If... (7 Replies)
Discussion started by: pektl
7 Replies

10. UNIX for Dummies Questions & Answers

shell script problem

hi all. im using the awk command to search a file for a matching number. lets say the numbers in the file are 4588281, 4588282 and 4588283. my problem is when i search for 8, the three numbers above appear. I want to have it so that if i search for any number that is not matching EXACTLY... (2 Replies)
Discussion started by: djt0506
2 Replies

Featured Tech Videos