LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-12-2004, 11:03 AM   #1
djgerbavore
Member
 
Registered: Jun 2004
Location: PA
Distribution: Fedora (latest git kernel)
Posts: 458

Rep: Reputation: 30
unixs shell commands


are sed and grep, type of perl scripts??? As learning perl i noticed alot of similarity between perl's reg. exprs and sed and grep commands. I think i'm having an epiphany..hahah

i typed man grep | grep "perl" and found that (i think?) it uses perl regexp...
just wanted to know,

perl seems to be a pretty neat language to learn. However some of its commands and syntax are little confusing at times.
 
Old 10-12-2004, 11:13 AM   #2
mirradric
Member
 
Registered: May 2004
Location: Singapore
Distribution: Debian woody and debian sarge
Posts: 188

Rep: Reputation: 31
just because something uses regular expression doesn't mean that it is in perl. In fact, regular expressions are used by many other tools and languages, like java...
 
Old 10-12-2004, 11:14 AM   #3
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Posts: 952

Rep: Reputation: 217Reputation: 217Reputation: 217
Nope. perl is a type of script probably based on sed and grep which have been around since 1969 or so (when Unix was written).

The GNU version of these probably from around the time Linux came into the picture.

An extract (unedited) from the Jargon File is reproduced below:
PERL
[Practical Extraction and Report Language, a.k.a. Pathologically Eclectic Rubbish Lister] An interpreted language developed by Larry Wall, author of patch(1) and rn(1)). Superficially resembles awk, but is much hairier, including many facilities reminiscent of sed(1) and shells and a comprehensive Unix system-call interface.

And now "regexp" from the same source.
Common written and spoken abbreviation for regular expression, one of the wildcard patterns used, e.g., by Unix utilities such as grep(1), sed(1), and awk(1). These use conventions similar to but more elaborate than those described under glob. ... it is sufficient to note that regexps also allow complemented character sets using ^; thus, one can specify ‘any non-alphabetic character’ with [^A-Za-z].

End
 
Old 10-12-2004, 12:12 PM   #4
avarus
Member
 
Registered: Apr 2004
Location: Oxford, UK
Distribution: Ubuntu, Debian, various
Posts: 230
Blog Entries: 5

Rep: Reputation: 33
As previous posters have said, Perl came much later than the venerable 'sed' and 'grep'. However, the regex syntax in Perl 5 is very powerful and has thus been incorporated into recent GNU versions of these tools (eg. compare grep with egrep).

You can now find support for 'Perl Compatible Regular Expressions' (PCREs) for just about any language (eg Java, C) via addon libraries, but this does not mean the programs actually contain any Perl.

TIM
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Basic shell commands pppaaarrrkkk Linux - Newbie 7 02-05-2007 07:31 AM
Commands/Shell script ?? paraiso Linux - Newbie 11 04-21-2005 10:58 AM
Shell commands in HTML? Spooky Programming 8 01-01-2004 11:18 AM
shell commands! krishlinux General 1 10-05-2003 04:47 AM
how to delete old shell commands a_hic Linux - Newbie 4 05-01-2003 06:16 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration