Sponsored Content
Top Forums Shell Programming and Scripting Uniq not doing what I want it to Post 302568859 by MaindotC on Friday 28th of October 2011 12:14:47 PM
Old 10-28-2011
Quote:
Originally Posted by felipe.vinturin
The problem is with the grep "-v" option, it prints all lines that don't match a pattern, in your case the value of ${i}.

Try:
Code:
for i in $(cat dont_touch_list);do grep -iv $i master_list; done | sort | uniq > master_touch_list

This did not produce the desired result. For some reason the master_touch_list still had items in it from the dont_touch_list. But thank you for the suggestion!

Quote:
Originally Posted by ahamed101
Try this...
Code:
grep -vf dont_touch_list master_list > master_touch_list

--ahamed
Without going through and individually checking each and every item in the master_touch_list this appears to have worked. Running a for loop grepping each item from the dont_touch_list in the master_touch_list produced no results so I think I'm good. Appreciate your help and I'll keep murphy's suggestion in mind as well.
 

10 More Discussions You Might Find Interesting

1. HP-UX

help on UniQ

All, Can anybody provide me the links to the documentation on UniQPrint? I need to prepare some documents to help my co-workers to learn UniQPrint. Regards, Vishal (0 Replies)
Discussion started by: vishal_ranjan
0 Replies

2. Shell Programming and Scripting

who - uniq output

Hi, I'd like to have a script what takes the 'who' output and grabs the user names and outputs just the user name, and no duplicates. I know I could do something like: who | awk '{print $1}' | uniq -u but I'd like to stay away from using the 'uniq' comand and just use awk. Thanks (5 Replies)
Discussion started by: lochraven
5 Replies

3. Shell Programming and Scripting

How to use uniq on a certain field?

How can I use uniq on a certain field or what else could I use? If I want to use uniq on the second field and the output would remove one of the lines with a 5. bob 5 hand jane 3 leg jon 4 head chris 5 lungs (1 Reply)
Discussion started by: Bandit390
1 Replies

4. UNIX for Dummies Questions & Answers

Difference between plain "uniq" and "uniq -u"

Dear all, It's not entirely clear to me from manpage the difference between them. Why we still need "-u" flag? - monkfan (3 Replies)
Discussion started by: monkfan
3 Replies

5. Shell Programming and Scripting

Help with uniq command

I call.... cat 1.txt | uniq -c Sample of whats in 1.txt vmstat cd exit w cd cd cd newgrp xinit f cd cd cd rlogin (2 Replies)
Discussion started by: Bandit390
2 Replies

6. Shell Programming and Scripting

Keep the last uniq record only

Hi folks, Below is the content of a file 'tmp.dat', and I want to keep the uniq record (key by first column). However, the uniq record should be the last record. 302293022|2|744124889|744124889 302293022|3|744124889|744124889 302293022|4|744124889|744124889 302293022|5|744124889|744124889... (4 Replies)
Discussion started by: ChicagoBlues
4 Replies

7. Shell Programming and Scripting

uniq -c

When I do uniq -c on a list of sorted numbers, for eg: 1 1 2 2 2 3 3 4 It outputs 2 1 3 2 2 3 1 4. Now, is there a way to sort on the column that "uniq -c" produced? (2 Replies)
Discussion started by: prasanna1157
2 Replies

8. Shell Programming and Scripting

uniq commmand

Hi I'm having a file (extract.txt) which contains lots of repeated values i want to extract it only with unique values,while am using the the uniq command It result's with 1510 lines this too have the duplicates,pls help me on this. I attached my extract.txt file as attachment here. ... (2 Replies)
Discussion started by: thelakbe
2 Replies

9. OS X (Apple)

Uniq tag

Hello, I have recently imported all my scripts into OS X. There is one unix command that is problematic in the new environment: sort temp7.txt | uniq -u -w4 > temp8.txt The system doesn't seem to like the -w tag. Is there an alternative command? Here is the objective: Data: 1234 aaa... (1 Reply)
Discussion started by: palex
1 Replies

10. Shell Programming and Scripting

Uniq help

hello I want to check on first column duplicates and print the unique first and second columns My trial output is not generating what I needed, i.e the second column. thanks in advance (5 Replies)
Discussion started by: bhargavpbk88
5 Replies
CURLOPT_DNS_SERVERS(3)					     curl_easy_setopt options					    CURLOPT_DNS_SERVERS(3)

NAME
CURLOPT_DNS_SERVERS - set preferred DNS servers SYNOPSIS
#include <curl/curl.h> CURLcode curl_easy_setopt(CURL *handle, CURLOPT_DNS_SERVERS, char *servers); DESCRIPTION
Pass a char * that is the list of DNS servers to be used instead of the system default. The format of the dns servers option is: host[:port][,host[:port]]... For example: 192.168.1.100,192.168.1.101,3.4.5.6 The application does not have to keep the string around after setting this option. DEFAULT
NULL - use system default PROTOCOLS
All EXAMPLE
TODO AVAILABILITY
This option requires that libcurl was built with a resolver backend that supports this operation. The c-ares backend is the only such one. Added in 7.24.0 RETURN VALUE
Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, CURLE_NOT_BUILT_IN if support was disabled at compile-time, CURLE_BAD_FUNCTION_ARGUMENT when given an invalid server list, or CURLE_OUT_OF_MEMORY if there was insufficient heap space. SEE ALSO
CURLOPT_DNS_LOCAL_IP4(3), CURLOPT_DNS_CACHE_TIMEOUT(3), libcurl 7.54.0 December 21, 2016 CURLOPT_DNS_SERVERS(3)
All times are GMT -4. The time now is 01:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy