The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Can I read a file character by character? murtaza Shell Programming and Scripting 4 04-27-2009 06:51 AM
Korn: How to loop through a string character by character shew01 Shell Programming and Scripting 10 12-02-2008 07:58 AM
read a variable character by character, substitute characters with something else vipervenom25 UNIX for Dummies Questions & Answers 2 06-06-2008 04:18 PM
Can i read a file character by character karnan Shell Programming and Scripting 6 05-19-2008 03:22 AM
Searching a string for a character turbulence Shell Programming and Scripting 7 01-12-2006 09:56 AM

Closed Thread
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 01-04-2006
MizzGail's Avatar
MizzGail MizzGail is offline
Registered User
  
 

Join Date: Sep 2001
Location: Syracuse, NY
Posts: 164
searching for $ character

I need to search in text files for the $ character. I tried putting it in double quotes and single quotes . ie grep "$" filename but unix finds everything in the file.

Whats the best way to do this?

thanks
  #2 (permalink)  
Old 01-04-2006
tmarikle tmarikle is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2005
Posts: 683
Try searching for \$

The backslash indicates that the $ is literal an should not be used to expand a variable or as an end of line indicator.
  #3 (permalink)  
Old 01-04-2006
MizzGail's Avatar
MizzGail MizzGail is offline
Registered User
  
 

Join Date: Sep 2001
Location: Syracuse, NY
Posts: 164
that doesn't work either.
However, I just got it to work in an sql query against an informix table using [$] and it appears this works in the unix command too!

tanks!
  #4 (permalink)  
Old 01-05-2006
akrathi akrathi is offline
Registered User
  
 

Join Date: Sep 2005
Posts: 41
try this :

grep '\$' filename

Thanks
Ashok
  #5 (permalink)  
Old 01-05-2006
Ygor's Avatar
Ygor Ygor is offline Forum Staff  
Moderator
  
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,409
Try fgrep or grep -F
Closed Thread

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 07:58 AM.


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