your code seems like it might do the trick. but let me give a bit more explanation of the problem im having.
sometimes in the file i'm using, there are words like this: db-airplane, db-12.airplane.
in cases like that, your code turns the words into db-helicopter, db-12.helicopter.
you see what i'm saying? I dont want the code to touch anything in the file that isn't "airplane", alone. all i want is to replace places were the airplane stands alone.
Hello.
I have a dir of 1500+ dir. In these dirs is a file host, with a tag <x_tag>.
I need to :
1. grep for all dir that contain this host file that contain <x_tag>
2. print a list of these host files containing <x_tag>
is this better to egrep this? (5 Replies)
I am having a heck of a time trying to write a script that will grep for multiple strings in a single file. I am really at my wits end here and I am hoping to get some feedback here.
Basic information:
OS: Solaris 9
Shell: KSH
Oracle Database server
I was trying to grep through a file... (5 Replies)
Trying to find a way to grep for two names on a line. Both names must appear on the same line so '|' / OR is out.
So far, I'm just messing around and I've got
find . -name "*" | xargs grep "Smith"
Let me explain. I'm at a top level and need to know all the names of the files that... (6 Replies)
I've got this command that I've been using to find strings on the same line, say I'm doing a search for name:
find . -name "*" | xargs grep -i "Doe" | grep -i "John" > output.txt
This gives me every line in a file that has John and Doe in it. I'm looking to add a OR operator for the second... (5 Replies)
QUESTION1:
How do you grep only an exact string. I am using Solaris10 and do not have any GNU products installed.
Contents of car.txt
CAR1_KEY0
CAR1_KEY1
CAR2_KEY0
CAR2_KEY1
CAR1_KEY10
CURRENT COMMAND LINE: WHERE VARIABLE CAR_NUMBER=1 AND KEY_NUMBER=1
grep... (1 Reply)
Im stumped on this one. Id like to echo into a .txt file all names for an xml feed in a huge folder. Can that be done?? Id need to echo <name>This name</name> in client.xml files.
$path="/mnt/windows/path"
echo 'recording names'
cd "$path"
for names in $path
than Im stuck on... (2 Replies)
I have 3-column tab separated data that looks like the following:
act of+n-a-large+vn-tell-v 0.067427
act_com of+n+n-a-large-manufacturer-n 0.129922
act-act_com-com in+n-j+vn-pass-aux-restate-v 0.364499666667
com nmod+n-j+ns-invader-n 0.527521
act_com-com obj+n-a-j+vd-contribute-v 0.091413... (2 Replies)
more data.txt
i need this exacted from data.txt
This is the command i tried
sed -n "/Start_of_DISK_info:\/u/,/End_of_DISK_info:\/u/p" data.txtBut, unfortunately it does not do an exact match. Instead, it prints text between both these strings /u & /u/tmp like below.
i need this... (6 Replies)
Discussion started by: mohtashims
6 Replies
LEARN ABOUT BSD
bm
BM(PUBLIC) BM(PUBLIC)
NAME
bm - search a file for a string
SYNOPSIS
/usr/public/bm [ option ] ... [ strings ] [ file ]
DESCRIPTION
Bm searches the input files (standard input default) for lines matching a string. Normally, each line found is copied to the standard out-
put. It is blindingly fast. Bm strings are fixed sequences of characters: there are no wildcards, repetitions, or other features of regu-
lar expressions. Bm is also case sensitive. The following options are recognized.
-x (Exact) only lines matched in their entirety are printed
-l The names of files with matching lines are listed (once) separated by newlines.
-c Only a count of the number of matches is printed
-e string
The string is the next argument after the -e flag. This allows strings beginning with '-'.
-h No filenames are printed, even if multiple files are searched.
-n Each line is preceded by the number of characters from the beginning of the file to the match.
-s Silent mode. Nothing is printed (except error messages). This is useful for checking the error status.
-f file
The string list is taken from the file.
Unless the -h option is specified the file name is shown if there is more than one input file. Care should be taken when using the charac-
ters $ * [ ^ | ( ) and in the strings (listed on the command line) as they are also meaningful to the Shell. It is safest to enclose the
entire expression argument in single quotes ' '.
Bm searches for lines that contain one of the (newline-separated) strings, using the Boyer-Moore algorithm. It is far superior in terms of
speed to the grep (egrep, fgrep) family of pattern matchers for fixed-pattern searching, and its speed increases with pattern length.
SEE ALSO grep(1)DIAGNOSTICS
Exit status is 0 if any matches are found, 1 if none, 2 for syntax errors or inaccessible files.
AUTHOR
Peter Bain (pdbain@wateng), with modifications suggested by John Gilmore
BUGS
Only 100 patterns are allowed.
Patterns may not contain newlines.
If a line (delimited by newlines, and the beginning and end of the file) is longer than 8000 charcters (e.g. in a core dump), it will not
be completely printed.
If multiple patterns are specified, the order of the ouput lines is not necessarily the same as the order of the input lines.
A line will be printed once for each different string on that line.
The algorithm cannot count lines.
The -n and -c work differently from fgrep.
The -v, -i, and -b are not available.
4th Berkeley Distribution 8 July 1985 BM(PUBLIC)