The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
simple grep is not working for me samnyc Shell Programming and Scripting 4 04-02-2009 03:46 PM
grep not working u263066 UNIX for Dummies Questions & Answers 5 09-26-2008 08:22 AM
cat and grep not working jphess UNIX for Advanced & Expert Users 3 09-08-2008 04:51 PM
grep -r isn't working harishmitty SUN Solaris 8 09-04-2008 02:44 AM
Grep not working - special characters?? gugs Shell Programming and Scripting 3 07-31-2008 11:22 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-24-2009
spc432 spc432 is offline
Registered User
  
 

Join Date: Jul 2009
Posts: 17
grep is not working for few extensions

HI all,
I am trying to grep few words in with file extension of srw. But grep is not giving any output. File has all the permisssions to read,write,execute.

If i try to search manually i can notice words whatever i want in the file.

my command is very simple
Code:
grep -i "word" *.srw
can u tell me any other limitations required for file size or any other things...

I copied file from windows to UNIX. after copy i observerd that "\377\376" added at the first line automatically. Is this creates any issue?

Last edited by spc432; 08-24-2009 at 03:27 AM.. Reason: for clear idea
  #2 (permalink)  
Old 08-24-2009
thanhdat's Avatar
thanhdat thanhdat is offline
Registered User
  
 

Join Date: Aug 2008
Location: Paris
Posts: 107
try the following sed command and see if it works
Code:
sed -n '/[wW]ord/p' *.srw
  #3 (permalink)  
Old 08-24-2009
spc432 spc432 is offline
Registered User
  
 

Join Date: Jul 2009
Posts: 17
Hi thanhdat,

Its working fine. But I copied file from windows to UNIX. After copy, I observerd that "\377\376" added at the first line automatically. If i remove this, grep is working fine.
can any one tell why "\377\376" added at the begining for all the files....
  #4 (permalink)  
Old 08-24-2009
dennysv dennysv is offline
Registered User
  
 

Join Date: Feb 2005
Posts: 23
try dostounix to fix the file issue and try using grep
Code:
dostounix file > newfile
  #5 (permalink)  
Old 08-25-2009
thanhdat's Avatar
thanhdat thanhdat is offline
Registered User
  
 

Join Date: Aug 2008
Location: Paris
Posts: 107
Well, "^\377\376" means little endian in Windows Unicode format.
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:12 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0