Sponsored Content
Top Forums Shell Programming and Scripting Read from "list1" and list matches in "list2" Post 302685517 by lewk on Monday 13th of August 2012 04:35:06 AM
Old 08-13-2012
Read from "list1" and list matches in "list2"

I want to print any matching IP addresse in List1 with List 2;

List 1

List of IP addresses;

Code:
161.85.58.210
250.57.15.129
217.23.162.249
74.76.129.101
30.221.177.237
3.147.200.59
170.58.142.64
127.65.109.33
150.167.242.146
223.3.20.186
25.181.180.99
2.55.199.32

List 2:

The lines in List2 is unstructured and contains other letters and characters.

Code:
183.223.16.161 #@%@#%Q!GHGAA
192.125.88.251 #@ahj*(&ederfG
@#$%@#$SDFFGRGW%$%%EQ
29.129.51.29
130.5.166.219
2345346hfdaae577R%R{}a
243.153.8.83
234546weh344343t
11.158.210.78
238.108.3.245
adf23523452
119.49.56.48 fwfqty$bbaaaght*(*(%%gf
170.58.142.64 rrwwbbhhhh
127.65.109.33 ##$666Hsssssssssssssss
$^&*^&*SAFRERTERTRE
17.72.208.209
%WH%HFNTY*&^&*$^&8
196.41.206.224
169.2.253.45$^tgwq
7.165.9.249


Result
Code:
170.58.142.64
127.65.109.33

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to request a "read" or "delivered" receipt for mails

Dears, I've written a script which allows me to send mails in different formats with different attaches. Now I still want to add a feature to this script. My users would like to be able to receive a "read" or "delivered" receipt for their mails. The script send mails on behalve of an specific... (1 Reply)
Discussion started by: plelie2
1 Replies

2. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

3. Shell Programming and Scripting

read -p "prompt text" foo say "read: bad option(s)" in Bourne-Shell

Hallo, i need a Prompting read in my script: read -p "Enter your command: " command But i always get this Error: -p: is not an identifier When I run these in c-shell i get this error /usr/bin/read: read: bad option(s) How can I use a Prompt in the read command? (9 Replies)
Discussion started by: wiseguy
9 Replies

4. Shell Programming and Scripting

cat $como_file | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g'

hi All, cat file_name | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g' Can this be done by using sed or awk alone (4 Replies)
Discussion started by: harshakusam
4 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. Shell Programming and Scripting

how to use "cut" or "awk" or "sed" to remove a string

logs: "/home/abc/public_html/index.php" "/home/abc/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" how to use "cut" or "awk" or "sed" to get the following result: abc abc xyz xyz xyz (8 Replies)
Discussion started by: timmywong
8 Replies

7. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

8. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

9. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies
certmonger(1)						      General Commands Manual						     certmonger(1)

NAME
getcert SYNOPSIS
getcert list [options] DESCRIPTION
Queries certmonger for a list of certificates which it is monitoring or attempting to obtain. ENROLLMENT OPTIONS
-c NAME List only entries which use the specified CA. The name of the CA should correspond to one listed by getcert list-cas. LISTING OPTIONS
-r List only entries which are either currently being enrolled or refreshed. -t List only entries which are not currently being enrolled or refreshed. -d DIR List only entries which use an NSS database in the specified directory for storing the certificate. -n NAME List only tracking requests which use an NSS database and the specified nickname for storing the certificate. -f FILE List only tracking requests which specify that the certificate should be stored in file. -i FILE List only tracking requests which use this request nickname. BUGS
Please file tickets for any that you find at https://fedorahosted.org/certmonger/ SEE ALSO
certmonger(8) getcert(1) getcert-list-cas(1) getcert-request(1) getcert-resubmit(1) getcert-start-tracking(1) getcert-stop-tracking(1) certmonger-certmaster-submit(8) certmonger-ipa-submit(8) certmonger_selinux(8) certmonger Manual 3 November 2009 certmonger(1)
All times are GMT -4. The time now is 11:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy