01-30-2009
grep checks by line, not by file.
Is your example of Bob on one line and Smith on another what you are trying to accomplish? Merely to see if two things exist inside a file anywhere?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I did not understand why the following did not work out as I expected:
find . -name "pqp.txt" | grep -v "Permission"
I thought I would be able to catch whichever paths containing my pqp.txt file without receiving the display of messages such as "find: cannot access... Permisson... (1 Reply)
Discussion started by: 435 Gavea
1 Replies
2. Shell Programming and Scripting
Howdy folks,
I am fairly new to scripting but have lost of expirience in c++, pascal, and a few other. I am trying to complete a file search script that is sent a file name containing data to search that is arranged like this
"id","name","rating"
"1","bob","7"
etc
and an argument to... (1 Reply)
Discussion started by: dyrt
1 Replies
3. Shell Programming and Scripting
Hi all.
I have a problem at work which I have managed to break down into a simple test scenario:
I have written a monitoring script that outputs every second the status of various processes, but for now, lets just print the date
input.sh:
while true
do
date
sleep 1
done
This... (9 Replies)
Discussion started by: spudtheimpaler
9 Replies
4. Shell Programming and Scripting
$>cat file.txt
123 d3
234 abc 3
zyf 23
124 def 8
ghi kz0
...
...
I have the following output on the screen through <some command>.
$> <some command>
abc
def
ghi
...
...
I have to search for each of these patterns in the file.txt and print the lines in file.txt matching the... (4 Replies)
Discussion started by: VNR
4 Replies
5. Ubuntu
Hi everybody,
I have a big file with blast results (if you know what this means, otherwise look at it just as a text file with a specific form).
I am trying to extract some ids from within this file, which have certain parameters.
For example, some Of my IDs have the term 'No hit results'... (1 Reply)
Discussion started by: frymor
1 Replies
6. Ubuntu
Hi everybody,
I have a big file with blast results (if you know what this means, otherwise look at it just as a text file with a specific form).
I am trying to extract some ids from within this file, which have certain parameters.
For example, some Of my IDs have the term 'No hit results'... (6 Replies)
Discussion started by: frymor
6 Replies
7. Shell Programming and Scripting
I am trying to extract the file names alone, for example "TVLI_STATS_NRT_XLSTWS03_20120215_132629.csv", from below output
which was given by the grep.
sam:/data/log: grep "C10_Subscribe.000|subscribe|newfile|" PDEWG511_TVLI_JOB_STATS.ksh.201202*
Output:
... (6 Replies)
Discussion started by: siteregsam
6 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I have a number of files containing the information below.
"""""
Fundallinfo
6.3950 14.9715 14.0482
"""""
I would like to grep for Fundallinfo and use it to read the next line? I ideally would like to read the three numbers that follow in the next line and... (2 Replies)
Discussion started by: Paul Moghadam
2 Replies
9. Shell Programming and Scripting
So, this is weird... I'm running this command:
iotop -o -P -k -bt -d 5
I'd like to save the output relelvant to rsyslogd to a file, so I do this:
iotop -o -P -k -bt -d 5 | grep rsyslogd >> /var/log/rsyslogd
Nothing is written to the file! I can write the full output to the file:
... (2 Replies)
Discussion started by: treesloth
2 Replies
10. OS X (Apple)
cat file
1 aaa
2 bbb
3 ccc
4 ddd
In TextEdit, I then copy the characters “ccc” to the clipboard. The problem is that the following command gives no output:
bash-3.2$ pbpaste | grep - file
Desired output:
3 ccc
What should the syntax be for that command? I am using MacOS El... (3 Replies)
Discussion started by: palex
3 Replies
DBD(1) Netatalk 2.2 DBD(1)
NAME
dbd - CNID database maintenance
SYNOPSIS
dbd [-evx] {-d [-i] | -s [-c|-n] | -r [-c|-f] | -u} volumepath
DESCRIPTION
dbd can dump, scan, reindex and rebuild Netatalk dbd CNID databases. It must be run with appropiate permissions i.e. as root. dbd -s|-r
can be run on active volumes, but dbd -rf, which wipes the db before rebuilding it, checks and enforces that the chosen volume is not in
use.
COMMANDS
-d
Dump CNID database. With -i dump indexes too.
-s
Scan volume:
o Compare CNIDs in database with volume
o Test if .AppleDouble directories exist
o Test if AppleDouble files exist
o Report orphaned AppleDouble files
o Report directories inside .AppleDouble directories
o Check name encoding by roundtripping, log on error
o Check for orphaned CNIDs in database (requires -e)
o Open and close adouble files
Options:
-c Don't check .AppleDouble stuff, only check orphaned. -n Don't open CNID database, skip CNID checks, only traverse
filesystem
-r
Rebuild volume. With -f wipe database and rebuild from CNIIDs stored in AppleDouble files.
o Sync CNIDSs from database with volume
o Ensure .AppleDouble directories exist
o Ensure AppleDouble files exist
o Delete orphaned AppleDouble files
o Report directories inside .AppleDouble directories
o Check name encoding by roundtripping, log on error
o Delete orphaned CNIDs in database (requires -e)
o Open and close adouble files
Options:
-c Don't create .AppleDouble stuff, only cleanup orphaned.
-f Wipe database and rebuild from IDs stored in AppleDouble files, only available for volumes without nocnidcache option.
Implies -e.
-u
Upgrade:
Opens the database which triggers any necessary upgrades, then closes and exits.
OPTIONS
-e
Only work on inactive volumes and lock them (exclusive)
-x
Rebuild indexes (just for completeness, mostly useless!)
-v
verbose
WARNING
In order to be able to run -rf reconstructing the CNIDs in the database from the AppleDouble files, make sure you've run a -r rebuild
sometimes before, where the CNIDs then would have been synched between database and AppleDouble files.
Also be careful about the option nocnidcache. Avoid this option if at all possible, because if prevents you from being able to use -f.
CNID BACKGROUND
The CNID backends maintains name to ID mappings. If you change a filename outside afpd(8) (shell, samba), the CNID db will not know and not
reflect that change. Netatalk tries to recover from such inconsistencies as gracefully as possible. The mechanisms to resolve such
inconsistencies may fail sometimes, though, as this is not an easy task to accomplish. E.g. if several names in the path to the file or
directory have changed, things may go wrong.
If you change a lot of filenames at once, chances are higher that the afpds fallback mechanisms fail, i.e. files will be assigned new IDs,
even though the file hasn't changed.
SEE ALSO
cnid_metad(8), cnid_dbd(8)
Netatalk 2.2 12 Oct 2010 DBD(1)