Sponsored Content
Full Discussion: grep -v while loop
Top Forums UNIX for Dummies Questions & Answers grep -v while loop Post 302104584 by bobo on Thursday 25th of January 2007 10:11:32 PM
Old 01-25-2007
Data Please advise!

What I try to do is to get the different between alist and blist; in this case the result should be:

d
e

My alist is unknown list of data and so is blist. Let's say my alist contains:

e
b
c
a
d

and my blist contains:

c
a
b


Using the code that I have:

#!/usr/bin/ksh
cat blist | while read line
do
grep -V "$line" alist > data
done

What do I have to do to have a data file that contain:

e
d

Please advise! I tried "diff" it is not worked!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep in a loop

Hi , I am trying a script which takes user input userid . I am stuck how to check whether that is a valid user id or not in the audit log files. My code is : cd $CCP_AUDIT cat * > /export/home/$USR/l***/files echo "UserId:\c" read UserId #Date Function echo "DATE : \c" read xxx I... (7 Replies)
Discussion started by: gundu
7 Replies

2. Shell Programming and Scripting

Grep commands in loop

Hi All, Reference to my previous post I need to compare all the lines in the file1 with file2 for this condition if file1 {$3,$5} ==file2 {$3,$5} then grep file2{$1}latest date. need output in file3 10/04/2008 09/04/2008 09/04/2008 08/04/2008 can anyone suggest me Thanks... (0 Replies)
Discussion started by: karthikn7974
0 Replies

3. Shell Programming and Scripting

Help with grep inside an if loop

Hello All, I have been reading posts on here for a while, but this is my first post. I have a document in which many sentences appear, and I am piping it through an exterior script which will tag each word in the document with its part of speech (not part of my script, just background). The... (3 Replies)
Discussion started by: daf189
3 Replies

4. Shell Programming and Scripting

Using grep within a while loop

Hi all, I have the below script to get input but i cannot get grep to work. input1.txt AAAAAAAAG input2.txt >gi|184009.1| LEAFY-like |AAAAAAAAGSGGGDHLPY However, when i use grep -f input1.txt input2.txt i cannot get any output matches (note that the match is underlined). Is it... (8 Replies)
Discussion started by: turkishvan
8 Replies

5. UNIX for Dummies Questions & Answers

grep sed and a loop

:wall: I have a requirement to search a log file that never rotates for certain values. If I find them I pipe them to a another file. To log file is constanyl being appened with new lines and never rotating Easy so far. The problem is I dont want to pipe out matches already seen before. ... (3 Replies)
Discussion started by: gunnahafta
3 Replies

6. Shell Programming and Scripting

Help on grep in a do while loop

So this is what I'm trying to do: I have a file called registry.txt which has a list of registry entries I want to search for. I have another file called inctrl.txt on which I want to perform the search on. Here's the example contents of registry.txt SOFTWARE\Microsoft\Security... (3 Replies)
Discussion started by: r4v3n
3 Replies

7. Red Hat

using grep in a while loop

Hello everybody, I have been searching it, but it seems I am unable to find the correct information, that s why I am asking you guys, hoping somebody get an idea. Here is my problem : I want a script to loop until a string is identified in a log file. Here is the script : #!/bin/sh... (5 Replies)
Discussion started by: guyiom
5 Replies

8. Homework & Coursework Questions

GREP loop

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: I need to search through the users home directories for keywords, display them. The code listed below will show... (7 Replies)
Discussion started by: jcllns1
7 Replies

9. UNIX for Beginners Questions & Answers

Grep command in a loop

Hello - I am running a script that is outputting to a log. Let call it output.log I would like to monitor that log until the line "Build Successful" is found. I think I would need to use the grep command. How would I do that in a loop? Thanks Marty (1 Reply)
Discussion started by: MSpeare
1 Replies

10. Shell Programming and Scripting

Ps ax with grep in loop

Hello, I have built the following script to check if processes supplied by the argument are running or not. #!/bin/bash PROCLIST=$1 PROCESS="0" ERROR_PROCS="" IFS='+' read -ra ADDR <<< "$PROCLIST" for PROC in "${ADDR}"; do if ; then PROCESS=1 ... (9 Replies)
Discussion started by: nms
9 Replies
ZATHURA(1)																ZATHURA(1)

NAME
zathura - a document viewer SYNOPOSIS
zathura [OPTION]... zathura [OPTION]... FILE zathura [OPTION]... FILE PASSWORD DESCRIPTION
zathura is a highly customizable and functional document viewer. It provides a minimalistic and space saving interface as well as an easy usage that mainly focuses on keyboard interaction. OPTIONS
-e [xid], --reparent [xid] Reparents to window specified by xid -c [path], --config-dir [path] Path to the config directory -d [path], --data-dir [path] Path to the data directory -p [path], --plugins-dir [path] Path to the directory containing plugins --fork Fork into the background MOUSE AND KEY BINDINGS
J, K Go to the next or previous page h, k, j, l Scroll to the left, down, up or right direction Left, Down, Up, Right Scroll to the left, down, up or right direction ^t, ^d, ^u, ^y Scroll a half page left, down, up or right t, ^f, ^b, space, <S-space>, y Scroll a full page left, down, up or right gg, G, nG Goto to the first, the last or to the nth page ^c, Escape Abort a, s Adjust window in best-fit or width mode /, ? Search for text n, N Search for the next or previous result o, O Open document f Follow links : Enter command r Rotate by 90 degrees ^i Recolor R Reload document Tab Show index and switch to Index mode F5 Switch to fullscreen mode ^m Toggle inputbar ^n Toggle statusbar +, -, = Zoom in, out or to the original size zI, zO, z0 Zoom in, out or to the original size n= Zoom to size n mX Set a quickmark to a letter or number X 'X Goto quickmark saved at letter or number X q Quit Index mode k, j Move to upper or lower entry l Expand entry L Expand all entries h Collapse entry H Collapse all entries space, Return Select and open entry Mouse bindings Scroll Scroll up or down ^Scroll Zoom in or out Hold Button2 Pan the document Button1 Follow link COMMANDS
bmark Save a bookmark bdelete Delete a bookmark blist List bookmarks close Close document info Show document information help Show help page open, o Open a document offset Set page offset print Print document write, write! Save document (and force overwriting) export Export attachments CONFIGURATION
The default appearance and behaviour of zathura can be overwritten by modifying the zathurarc file (default path: ~/.config/zathura/zathu- rarc). For a detailed description please consult zathurarc(5). SEE ALSO
zathurarc(5) AUTHOR
pwmt.org 0.1.2 ZATHURA(1)
All times are GMT -4. The time now is 08:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy