Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Difference between code page used with grep and vi Post 302879746 by bakunin on Saturday 14th of December 2013 06:29:22 PM
Old 12-14-2013
There are several possible reasons for this:

First, how did you issue the grep command? If it was "grep -i", then you switched on case INsensitivity, which is not so easily done in vi (certainly not with a command switch). Make sure you really search for the same string in both cases.

Second, The file might contain some (terminal-) control codes, which are "interpreted away" when you pipe it through cat.

Have a look at the unaltered file with "od -ax" to get even the non-displayable characters.

I hopoe this helps.

bakunin
This User Gave Thanks to bakunin For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Code page in Unix

Hi, Can someone tell me how do I find the list of comptabile codepages on Linux(suse) , Is it /usr/lib/locale or somewhere else ? I was wandering if someone has expereince in using cycrillic chars (russian) in unix / linux ? Thanks (2 Replies)
Discussion started by: braindrain
2 Replies

2. UNIX for Dummies Questions & Answers

What is the main difference between grep and sed

What is the main difference between grep and sed (1 Reply)
Discussion started by: ss4u
1 Replies

3. UNIX for Dummies Questions & Answers

using Lynx and Grep to return search page rank - help

I am writing a script which will read in search terms from a text file and pass each line to Lynx. Lynx will grab the source html, then I want grep/tr, whatever to search for the first occurance of a term (mydomain.name), then delete from that 1st occurance on, creating a new end of file. Then... (0 Replies)
Discussion started by: roninuta
0 Replies

4. UNIX Desktop Questions & Answers

Difference grep, egrep and fgrep

Hi All, Can anyone please explain me the difference between grep, egrep and fgrep with examples. I am new to unix environment.. Your help is highly appreciated. Regards, ravi (2 Replies)
Discussion started by: ravind27
2 Replies

5. Shell Programming and Scripting

Getting source code of a page

I want to download a particular page from the internet and get the source code of the page in html format. I want to parse the source code to find a specific parameters using grep command. could someone tell me the linux command to download a specific page and parse the source code of it. ... (1 Reply)
Discussion started by: ahamed
1 Replies

6. Shell Programming and Scripting

Difference between '.*' and .* in grep

Hi What is the difference between grep '.*' xx and grep .* xx? What grep .* xx command will do where xx is file name. Thanks Sas (4 Replies)
Discussion started by: SasDutta
4 Replies

7. UNIX for Dummies Questions & Answers

Difference between grep, egrep & grep -i

Hi All, Please i need to know the difference between grep, egrep & grep -i when used to serach through a file. My platform is SunOS 5.9 & i'm using the korn shell. Regards, - divroro12 - (2 Replies)
Discussion started by: divroro12
2 Replies

8. Shell Programming and Scripting

Difference between 2 grep - commands

Hi, I need to know the difference between this commands: grep * *search* grep "*" *search* As far as i know does the 2nd command search for files which have a name with *search* and greps then all which have chars from a-z in the file content. But was does the first command?? Best... (1 Reply)
Discussion started by: xus
1 Replies

9. AIX

Code Page IBM-860

Helo all, I' trying to print Portuguese special characters like ç, ã, º, º . I already set my print queue for CODE PAGE of printer ibm.860 but every time i send a print test i receive the following error: 0782-059 Attribute name passed to subroutine piocmdout by program... (2 Replies)
Discussion started by: marques_rmc
2 Replies

10. Linux

IBM Code Page 437...

Hi all... Reference this URL: https://www.unix.com/unix-for-beginners-questions-and-answers/282400-lower-ascii-characters.html#post303037272 Researching in google for an answer showed the numerous times this has been asked for in various guises. So it inspired me to create a pseudo-IBM... (2 Replies)
Discussion started by: wisecracker
2 Replies
ZGREP(1)						      General Commands Manual							  ZGREP(1)

NAME
zgrep - search possibly compressed files for a regular expression SYNOPSIS
zgrep [ grep_options ] [ -e ] pattern filename... DESCRIPTION
Zgrep invokes grep on compressed or gzipped files. These grep options will cause zgrep to terminate with an error code: (-[drRzZ]|--di*|--exc*|--inc*|--rec*|--nu*). All other options specified are passed directly to grep. If no file is specified, then the standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep. If the GREP environment variable is set, zgrep uses it as the grep program to be invoked. EXIT CODE
2 - An option that is not supported was specified. AUTHOR
Charles Levert (charles@comm.polymtl.ca) SEE ALSO
grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1) ZGREP(1)
All times are GMT -4. The time now is 04:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy