Sponsored Content
Top Forums Shell Programming and Scripting Search a particular config in many files Post 302961009 by RudiC on Monday 23rd of November 2015 04:44:28 AM
Old 11-23-2015
No. Try
Code:
awk '/interface/ {IF = $0} /ip-helper/ {print FILENAME; print IF; print}' file1 file2
file1
  interface xxxxxx
  ip-helper 10.10.10.1
file2
  interface vlan3
  ip-helper 10.10.10.1

 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

new LAN, where are the config files?

We just moved to a new office so few things changed on our LAN. I am on Solaris and trying to find the files that hold the configuration for connecting to the servers. I changed the IP addresses to reflect the new addresses but still I get this error: “unknown sendmail : unable to qualify my own... (3 Replies)
Discussion started by: softarch
3 Replies

2. UNIX for Dummies Questions & Answers

Apache Config Files

Currently our Apache log files are huge, I want to put say a month's time limit on this, then when it hits the end of the month I would like it to start over writing. Does anyone know where the config file is for this and what its called? I also want to do exactly the same on wtmp config (who... (1 Reply)
Discussion started by: Webwitch
1 Replies

3. HP-UX

Config Files

Does anyone have a list of key config files and the respective paths for HP-UX? Or does anyone know where I can get a list similar to this? Thanks, TOdd (0 Replies)
Discussion started by: toddjameslane
0 Replies

4. Shell Programming and Scripting

parsing config file to create new config files

Hi, I want to use a config file as the base file and parse over the values of country and city parameters in the config file and generate separate config files as explained below. I will be using the config file as mentioned below: (config.txt) country:a,b city:1,2 type:b1... (1 Reply)
Discussion started by: clazzic
1 Replies

5. Shell Programming and Scripting

Shell script that will compare two config files and produce 2 outputs 1)actual config file 2)report

Hi I am new to shell scripting. There is a requirement to write a shell script to meet follwing needs.Prompt reply shall be highly appreciated. script that will compare two config files and produce 2 outputs - actual config file and a report indicating changes made. OS :Susi linux ver 10.3. ... (4 Replies)
Discussion started by: muraliinfy04
4 Replies

6. Shell Programming and Scripting

using perl config files

Hi, I have 2 perl SubRoutines (sub 1 and sub 2). I created two perl modules for these (Sub1.pm and Sub2.pm). How can I include these in a config file (say Config.cfg) and call the config file in my main script Rename.pl to use the 2 subroutines? Right now here are the content of Config.cfg... (1 Reply)
Discussion started by: CCFP
1 Replies

7. SuSE

Search all files based on first and in all listed files search the second patterns

Hello Linux Masters, I am not a linux expert therefore i need help from linux gurus. Well i have a requirement where i need to search all files based on first patterns and after seraching all files then serach second pattern in all files which i have extracted based on first pattern.... (1 Reply)
Discussion started by: Black-Linux
1 Replies

8. Shell Programming and Scripting

What's the best way to read config files?

(copied directly from my other thread about something else) At the moment, I just use... cat config_file|grep var_name|cut -d'=' -f2 ... which is fine for what I've been doing, but I'm not sure what to do when there are a variable number of entries and I want it go through them like a... (7 Replies)
Discussion started by: ninjaaron
7 Replies

9. Windows & DOS: Issues & Discussions

(VS 2008) New build config looking files from other folder build config

Hi Team, My new build configuration always looking for the files from the build where i copied from. please help me to resolve this. I am using Visual studio 2008.It has Qt 4.8. plugins,qml,C++ development I created new debug_new build configuration with additional preprocessor from the... (1 Reply)
Discussion started by: SA_Palani
1 Replies
JOIN(1) 						      General Commands Manual							   JOIN(1)

NAME
join - relational database operator SYNOPSIS
join [-an] [-e s] [-o list] [-tc] file1 file2 DESCRIPTION
Join forms, on the standard output, a join of the two relations specified by the lines of file1 and file2. If file1 is `-', the standard input is used. File1 and file2 must be sorted in increasing ASCII collating sequence on the fields on which they are to be joined, normally the first in each line. There is one line in the output for each pair of lines in file1 and file2 that have identical join fields. The output line normally con- sists of the common field, then the rest of the line from file1, then the rest of the line from file2. Fields are normally separated by blank, tab or newline. In this case, multiple separators count as one, and leading separators are dis- carded. These options are recognized: -an In addition to the normal output, produce a line for each unpairable line in file n, where n is 1 or 2. -e s Replace empty output fields by string s. -o list Each output line comprises the fields specified in list, each element of which has the form n.m, where n is a file number and m is a field number. -tc Use character c as a separator (tab character). Every appearance of c in a line is significant. SEE ALSO
sort(1), comm(1), awk(1). BUGS
With default field separation, the collating sequence is that of sort -b; with -t, the sequence is that of a plain sort. The conventions of join, sort, comm, uniq, look and awk(1) are wildly incongruous. 7th Edition April 29, 1985 JOIN(1)
All times are GMT -4. The time now is 05:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy