Sponsored Content
Top Forums Shell Programming and Scripting array + if in linux shell scripting Post 302523886 by CAch on Friday 20th of May 2011 08:40:48 AM
Old 05-20-2011
Hi Franklin,

I have tried ur code. It works well Smilie
But it shows output only for a single A file and its corresponding single B file.
Now, I need to run it for multiple files and save their data into new file.

I tried the following code, but it doesnt workSmilie

f
Code:
name=list1
exec<$fname
while read line
       do
 
        f2name=list2
        exec<$f2name
        while read line2
        do
 
        awk ' NR==1{a=$1; next} $2=="BBM" && $5==a {print $4}' $line $line2> $line"456"
        done
done

thanks for the help!!!!

---------- Post updated at 07:40 AM ---------- Previous update was at 06:04 AM ----------

Hi ygemici,

code given by you also works for single A file and single B file.
the output shown is :
Code:
RGF
HGD
ALA
ALA
ALA
ALA
ALA
ALA
ALA
ALA
ALA
ALA
ALA

Although I need to display only RGF

Kindly help me to work with multiple files at a time.

Last edited by radoulov; 05-20-2011 at 11:12 AM.. Reason: Code tags, please!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell scripting for Unix and/or Linux

Anyone here knows any reasonably priced courses for independent (not corporate) users that can point me to. Already know Unix commands/vi/etc but now need scripting too. Any replies will be appreciated. (2 Replies)
Discussion started by: FastFood
2 Replies

2. Linux

Difference between Linux and Unix and also C and C++ and also about Shell Scripting

Please Let me know this Que and Ans please Because i applied for a H1B VISA nad i have a INTERVIEW as soon so please "Difference between Linux and Unix and also C and C++ and also about Shell Scripting about all Questions and Answers ." (3 Replies)
Discussion started by: madhav
3 Replies

3. Linux

Linux game programing or just shell scripting

Well Acording to my job... Anyhelp plz. I need some basic scripting stuff. (3 Replies)
Discussion started by: Irish Jimmy
3 Replies

4. Linux

Linux/Unix Shell Scripting Book

I want to learn Linux/Unix shell scripting, I searched this forum but got some results for Unix Admin books and general Linux books. Would someone recommend a good Linux Shell Scripting book? I did order one book A Practical Guide to Linux(R) Commands, Editors, and Shell Programming ... (4 Replies)
Discussion started by: thoughts
4 Replies

5. Shell Programming and Scripting

Shell Scripting Linux

In shell Can I pass " to a program ? If not what is the work around ..? Can I define * as a wild card charecter that will return all the values from the files ..? I am trying to create a tool that will return the values from a property file . This tool has to support all the wild card... (1 Reply)
Discussion started by: app1sxv
1 Replies

6. Shell Programming and Scripting

Linux/Unix shell scripting vs Perl

Hi, I have general question: i have good working Perl script with .pl extension, and now I have to migrate all to another Linux box, and I was told that I can use only shell scripting, so I'm not sure how different those two things are, will it work without any changes . Is there anything smart I... (6 Replies)
Discussion started by: trento17
6 Replies

7. Shell Programming and Scripting

Assigning array values using awk in shell scripting

hi My script as below #!/bin/ksh for i in `seq 1 7` do a=$(awk '{print $i}' /home/rama/expenese.txt) done for i in `seq 1 7` do echo "${a}" done content of expense.txt is as below 5032 210179 3110 132813874 53488966 11459221 5300794 I want output as... (6 Replies)
Discussion started by: Ramakrishna V
6 Replies

8. Homework & Coursework Questions

Linux Shell Scripting If-else and Case

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: This is what is asked: If the user enters ‘3’, prompt the user for two file names. Verify that the file names... (2 Replies)
Discussion started by: cindy01
2 Replies

9. UNIX for Beginners Questions & Answers

Convert String to an Array using shell scripting in JSON file.

This is the sample json I have pasted here. I want all the IP address strings to be converted into an array. For example "10.38.32.202" has to be converted to everywhere in the JSON. There are multiple IPs in a JSON I am pasting one sample object from the JSON. But the IPs already in an Array... (11 Replies)
Discussion started by: vinshas1
11 Replies

10. Shell Programming and Scripting

Array size in C shell scripting

Hi, I would like to know how to define the size of the array in c shell scripting. (15 Replies)
Discussion started by: gopishrine
15 Replies
PSMERGE(1)						      General Commands Manual							PSMERGE(1)

NAME
psmerge - filter to merge several PostScript files into one SYNOPSIS
psmerge [ -oout.ps ] [ file.ps ... ] DESCRIPTION
Psmerge merges PostScript documents into a single document. It only works in the specific case the the files were created using the same application, with the same device setup and resources (fonts, procsets, patterns, files, etc) loaded. If the -o option is used, output will be sent to the file named, otherwise it will go to standard output. Psmerge will merge multiple files concatenated into a single file as if they were in separate files. AUTHOR
Copyright (C) Angus J. C. Duggan 1991-1995 SEE ALSO
psbook(1), psselect(1), pstops(1), epsffit(1), psnup(1), psresize(1), psmerge(1), fixscribeps(1), getafm(1), fixdlsrps(1), fixfmps(1), fix- macps(1), fixpsditps(1), fixpspps(1), fixtpps(1), fixwfwps(1), fixwpps(1), fixwwps(1), extractres(1), includeres(1) TRADEMARKS
PostScript is a trademark of Adobe Systems Incorporated. BUGS
psmerge is for a very specific case; it does not merge files in the general case. PSUtils Release 1 Patchlevel 17 PSMERGE(1)
All times are GMT -4. The time now is 03:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy