grep `abc\{3,5\}d`file - does what? URGENT!

  • marjeg
  • Newbie
  • Newbie
  • marjeg
  • Posts: 8

Post 3+ Months Ago

Hi!

Can anyone help me with what the command
grep `abc\{3,5\}d`file
does? URGENT!

:shock:

Maria from Sweden
  • theak
  • Proficient
  • Proficient
  • User avatar
  • Posts: 438
  • Loc: Taipei, Taiwan

Post 3+ Months Ago

Grep searches files for a specific string, 'abc\{3,5\}d' in your case, with the file searched called 'file' in your example.
  • marjeg
  • Newbie
  • Newbie
  • marjeg
  • Posts: 8

Post 3+ Months Ago

theak wrote:
Grep searches files for a specific string, 'abc\{3,5\}d' in your case, with the file searched called 'file' in your example.


Thanks for you answer! :)

Do you also know what more specific what does " 'abc\{3,5\}d'" means?

Even for someone like me unix can be quit confusing!
:lol:
  • theak
  • Proficient
  • Proficient
  • User avatar
  • Posts: 438
  • Loc: Taipei, Taiwan

Post 3+ Months Ago

It's the text grep is looking for, I have no idea what it could mean...
  • AnarchY SI
  • Web Master
  • Web Master
  • User avatar
  • Posts: 2521
  • Loc: /usr/src/MI

Post 3+ Months Ago

`abc\{3,5\}d`outputs abc{3,5}d to the console. it needs \{ so that it doesn't try to process the { instead.
where exactly did you get this concotion from? lol
  • Don2007
  • Web Master
  • Web Master
  • Don2007
  • Posts: 4923
  • Loc: NY

Post 3+ Months Ago

According to the man page the string abc would be matched at least 3 times but no more than 5. The \ is supported in egrep, not grep.
  • marjeg
  • Newbie
  • Newbie
  • marjeg
  • Posts: 8

Post 3+ Months Ago

AnarchY SI wrote:
`abc\{3,5\}d`outputs abc{3,5}d to the console. it needs \{ so that it doesn't try to process the { instead.
where exactly did you get this concotion from? lol


Hi there! Thanks a lot for yur answer! :D
I got it from some questions from a friend of mine...
Thanks again! /Maria
  • marjeg
  • Newbie
  • Newbie
  • marjeg
  • Posts: 8

Post 3+ Months Ago

Don2007 wrote:
According to the man page the string abc would be matched at least 3 times but no more than 5. The \ is supported in egrep, not grep.


Thanks for your answer! :D
Now I can finally relax!
Thank you so much! :D
Maria
  • Don2007
  • Web Master
  • Web Master
  • Don2007
  • Posts: 4923
  • Loc: NY

Post 3+ Months Ago

Don't tell me that you couldn't relax until you had the answer to that question. You get old fast that way.
  • JackB
  • Born
  • Born
  • JackB
  • Posts: 2

Post 3+ Months Ago

Also try typing "man grep" (no quotes) in the terminal for more information on what it does.

Here's a good tutorial on grep and regular expressions:
http://pegasus.rutgers.edu/~elflord/unix/grep.html

Post Information

  • Total Posts in this topic: 10 posts
  • Users browsing this forum: No registered users and 12 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.