Link to home
Start Free TrialLog in
Avatar of Jax Logan
Jax Logan

asked on

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...
Avatar of Kent Olsen
Kent Olsen
Flag of United States of America image

Hi newbie,

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

Avatar of Jax Logan
Jax Logan

ASKER

sure.
vi
then either
/8980
or
?8980
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?
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?
sorry, my comment should say 'I can' find that string on windows...
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
ASKER CERTIFIED SOLUTION
Avatar of Jax Logan
Jax Logan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial