Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 932
  • Last Modified:

Pattern not found in vi

I've got a strange problem: When I grep for a pattern (e.g. 8980) I find it in a file. But when I search for it in vi (forward or backwards) it says 'Pattern not found'.

The pattern is not broken by a linebreak in the file.

What up with dat? It's driving me bonkers...
0
php-newbie
Asked:
php-newbie
  • 4
  • 3
1 Solution
 
Kent OlsenData Warehouse Architect / DBACommented:
Hi newbie,

Can you post exactly what you're trying to run?

0
 
php-newbieAuthor Commented:
sure.
vi
then either
/8980
or
?8980
0
 
Kent OlsenData Warehouse Architect / DBACommented:
If the string "8980" is in the file, either of those commands should search for the next/previous occurence.

Are you looking for the string "8980" or a 2 character string with a hex value of "8980"?

Also, is your terminal type set correctly?
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
php-newbieAuthor Commented:
Hi Kdo,

I can't find that string exactly when I ftp the file to windows and use a text editor to search.
I'm looking for the string 8980...
Hmm, terminal I don't set. Should I try a TERM=vt100?
But I don't see how vi would care about the terminal type?
0
 
php-newbieAuthor Commented:
sorry, my comment should say 'I can' find that string on windows...
0
 
Kent OlsenData Warehouse Architect / DBACommented:
Most terminal emulators are vt100 or ANSI.  If you're using either one and there is no odd behavior other than this it's unlikely that that is the problem.

How big is the file?  Can you dump it and examine the contents?

  od -xa filename


Kent
0
 
php-newbieAuthor Commented:
DOH! I missed that the vi editor opened with a message 'line too long' so it didn't load the full document
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now