SunQuest
           UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
  #1  
Old March 8th, 2005, 12:03 PM
guggach guggach is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2004
Location: Middle Europa
Posts: 1,083 guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 19 h 49 m 57 sec
Reputation Power: 9
limits of grep

hi all,
i tried to grep the string '/**/'
no ways w/ every possible conbinations,
nota: i well know regexp.
no probls w/ sed or perl, but grep
any ideas
thanks
__________________
working on Solaris[5-9], preferred languages french and C.

Reply With Quote
  #2  
Old March 9th, 2005, 07:00 PM
munkfish's Avatar
munkfish munkfish is offline
funky munky
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2001
Location: UK
Posts: 1,446 munkfish User rank is Corporal (100 - 500 Reputation Level)munkfish User rank is Corporal (100 - 500 Reputation Level)munkfish User rank is Corporal (100 - 500 Reputation Level)munkfish User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 18 h 33 m
Reputation Power: 10
Popular versions of grep have the -E option to allow the use of extended regular expressions. Alternatively if you're just trying to search for the literal string '/**/' - escape the shell chars out as needed:
Code:
grep '\/\*\*\/' files

Reply With Quote
  #3  
Old March 10th, 2005, 02:09 AM
guggach guggach is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2004
Location: Middle Europa
Posts: 1,083 guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 19 h 49 m 57 sec
Reputation Power: 9
no ways w/ every possible conbinations,

Reply With Quote
  #4  
Old March 10th, 2005, 06:24 AM
zlutovsky zlutovsky is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Location: Prague, Czech Rep.
Posts: 116 zlutovsky User rank is Corporal (100 - 500 Reputation Level)zlutovsky User rank is Corporal (100 - 500 Reputation Level)zlutovsky User rank is Corporal (100 - 500 Reputation Level)zlutovsky User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 22 h 34 sec
Reputation Power: 6
Quote:
Originally Posted by guggach
no ways w/ every possible conbinations,



Hello guggach,

perhaps I do not quite understand your problem, but the following runs correctly on HP-UX:

grep "/**/" <<!
asdf sdfg ghf
asdf dfgh wert /**/ asf
asdf sdfg ghf
asdf sdfg ghf
asdf wert /**/ asf
!

Regards

Reply With Quote
  #5  
Old March 10th, 2005, 07:13 AM
guggach guggach is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2004
Location: Middle Europa
Posts: 1,083 guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 19 h 49 m 57 sec
Reputation Power: 9
ok, my grep is buggy yours is better !
whitch grep are you using ? xpg4, gnu, own ?

Reply With Quote
  #6  
Old March 10th, 2005, 09:11 AM
Paul Weaver Paul Weaver is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 9 Paul Weaver User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 45 m 11 sec
Reputation Power: 0
Solaris 8
/usr/bin/grep (10032 bytes)
$ /usr/bin/grep
Usage: grep -hblcnsviw pattern file . . .

zlutovsky's example works.

/usr/xpg4/bin/grep - 13900 bytes
$ /usr/xpg4/bin/grep
Usage: grep [-E|-F] [-c|-l|-q] [-bhinsvwx] [file ...]
grep [-E|-F] [-c|-l|-q] [-bhinsvwx] -e pattern... [-f pattern_file]...[file...]
grep [-E|-F] [-c|-l|-q] [-bhinsvwx] [-e pattern]... -f pattern_file [file...]

zlutovsky's example also works.

GNU grep 2.5.1 works (on my debian box) too

Reply With Quote
  #7  
Old March 15th, 2005, 07:44 AM
zlutovsky zlutovsky is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Location: Prague, Czech Rep.
Posts: 116 zlutovsky User rank is Corporal (100 - 500 Reputation Level)zlutovsky User rank is Corporal (100 - 500 Reputation Level)zlutovsky User rank is Corporal (100 - 500 Reputation Level)zlutovsky User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 22 h 34 sec
Reputation Power: 6
Quote:
Originally Posted by Paul Weaver
Solaris 8
/usr/bin/grep (10032 bytes)
$ /usr/bin/grep
Usage: grep -hblcnsviw pattern file . . .

zlutovsky's example works.

/usr/xpg4/bin/grep - 13900 bytes
$ /usr/xpg4/bin/grep
Usage: grep [-E|-F] [-c|-l|-q] [-bhinsvwx] [file ...]
grep [-E|-F] [-c|-l|-q] [-bhinsvwx] -e pattern... [-f pattern_file]...[file...]
grep [-E|-F] [-c|-l|-q] [-bhinsvwx] [-e pattern]... -f pattern_file [file...]

zlutovsky's example also works.

GNU grep 2.5.1 works (on my debian box) too



Hello guggach,

sorry for my late answer, I have not been here for a long time. I have used no spetial grep, it was grep probably on Linux, I do not remember.

Today I have rerun the script on HP-UX B.11.23, AIX 3 5, Linux 2.40.20-8 and on all these systems it works well.

Regards

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > limits of grep


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

IBM developerWorks




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway