10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying to create a cronjob that will run on startup that will look at a list.txt file to see if there is a later version of a database using database.txt as the source. The matching lines are written to output.
$1 in database.txt will be in list.txt as a partial match. $2 of database.txt... (2 Replies)
Discussion started by: cmccabe
2 Replies
2. Shell Programming and Scripting
I just want to match "binutils1_test" only, and print the match line only
lyang001@lyang001-OptiPlex-9010:/tmp$ cat file
zbinutils1_test
bbinutils1_test
binutils1_test
w-binutils1_test
lyang001@lyang001-OptiPlex-9010:/tmp$ cat file |grep -w 'binutils1_test'
... (7 Replies)
Discussion started by: yanglei_fage
7 Replies
3. Shell Programming and Scripting
Hello!
I have 2 files named tacs.tmp and tacDB.txt
tacs.tmp looks like this
0
10235647
102700
106800
107200
1105700
tacDB.txt looks like this
100100,Mitsubishi,G410,Handheld,,0,0,0
100200,Siemens,A53,Handheld,,0,0,0
100300,Sony Ericsson,TBD (AAB-1880030-BV),Handheld,,0,0,0... (2 Replies)
Discussion started by: Cludgie
2 Replies
4. Shell Programming and Scripting
file
11 2
12 6
13 7
114 6
011 7
if I'm searching for 11, output needed is
output:
11 2
011 7
Code: awk '$1 ~ /^11$/' file
I used the above to match exact, but it avoiding "011 7" line too, how to resolve this? (6 Replies)
Discussion started by: Roozo
6 Replies
5. Shell Programming and Scripting
Hi friends,
i am using the following grep command for exact word match:
>echo "sachin#tendulkar" | grep -iw "sachin"
output: sachin#tendulkar
as we can see in the above example that its throwinng the exact match(which is not the case as the keyword is sachin and string is... (6 Replies)
Discussion started by: neelmani
6 Replies
6. Shell Programming and Scripting
Hello,
My requirement is to iterate over all the lines of a file and compare them with a word and perform some operations if exact match is found.
For the snippet below, it works even if contents of line include "diff" and "diff:". I want it to work only if it is exactly "diff" and is not... (2 Replies)
Discussion started by: sarbjit
2 Replies
7. Shell Programming and Scripting
Hello Guys,
I am trying to make an exact match for an email address entered as an argument, using perl, however, it's not working if I put a "$" in the email address. See the below outputs,
Correct Match :
bash-2.03$ echo sandy@test.com | perl -wln -e 'print if /(^*\@test.com$)/i'... (6 Replies)
Discussion started by: suffisandy
6 Replies
8. Shell Programming and Scripting
I am trying to match a pattern exactly in a shell script. I have tried two methods
awk '/\<mpath${CURR_MP}\>/{print $1 $2}' multipath
perl -ne '/\bmpath${CURR_MP}\b/ and print' /var/tmp/multipath
Both these methods require that I use the escape character. I am guessing that is why... (8 Replies)
Discussion started by: bash_in_my_head
8 Replies
9. Shell Programming and Scripting
I'm trying to find a exact word match but couldn't do it.
ABC
ABC_NE
Searching for ABC_NE tried
grep -w </ABC_NE/>
grep "^ABC_NE$"
but didn't worked , any awk variants would also help.
---------- Post updated at 08:40 AM ---------- Previous update was at 06:48 AM ----------
I... (2 Replies)
Discussion started by: dinjo_jo
2 Replies
10. Shell Programming and Scripting
How to emulate grep -o option in perl.
I mean to print not all line, only the exact match.
echo "2A2 BB" | perl -ne 'print if /2A2/'
2A2 BB
I want to print only 2A2. (2 Replies)
Discussion started by: mirusnet
2 Replies