vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| When I read about Unix tools there seems to be a lot of overlap between them, like shells awk sed Perl Python C tcl/tk Java Lisp What's a beginner to do that can only learn one at a time? If I learn Perl, is there any reason at all to look at awk and sed? What does Python do that Perl doesn't? I like the thought of the C/tcl/tk combination, e.g. a simple way to put a graphical interface on my C apps, or so the legends go, but has Java made that obsolete? What does anyone use Lisp for? Please share some opinions. -- "Let us learn to dream, gentlemen, then perhaps we shall find the truth... But let us beware of publishing our dreams before they have been put to the proof by the waking understanding." -- Friedrich August Kekulé |
| |||
| On Fri, 24 Oct 2003 01:22:25 +0000 (UTC), Gregory L. Hansen <glhansen@steel.ucs.indiana.edu> wrote: > > > > When I read about Unix tools there seems to be a lot of overlap between > them, like > > shells > awk > sed > Perl > Python > C > tcl/tk > Java > Lisp > > What's a beginner to do that can only learn one at a time? If I learn > Perl, is there any reason at all to look at awk and sed? What does Python > do that Perl doesn't? I like the thought of the C/tcl/tk combination, > e.g. a simple way to put a graphical interface on my C apps, or so the > legends go, but has Java made that obsolete? What does anyone use Lisp > for? > > Please share some opinions. > > The shell is a command interpreter which stands between you and the kernel. Sed is an editor, the rest are programming languages with various focusses, or, in the case of C, a general language. The shell includes a high-level and immensely practical programming language, and you would be very wise to learn an sh-compatible shell like bash or zsh, before tackling any of the other languages. And then, once you have a handle on 'sh', skip the rest and go for broke: learn C, (which most of the others are written in :-) Learn the stream editor sed because it is very, very useful. -- Alan C Post validation at http://tinyurl.com/rv0y |
| |||
| In article <bn9ush$j0e$3@hood.uits.indiana.edu>, Gregory L. Hansen <glhansen@steel.ucs.indiana.edu> wrote: > >When I read about Unix tools there seems to be a lot of overlap between >them, like > > shells > awk > sed > Perl > Python > C > tcl/tk > Java > Lisp > >What's a beginner to do that can only learn one at a time? If I learn >Perl, is there any reason at all to look at awk and sed? What does Python >do that Perl doesn't? I like the thought of the C/tcl/tk combination, >e.g. a simple way to put a graphical interface on my C apps, or so the >legends go, but has Java made that obsolete? What does anyone use Lisp >for? > >Please share some opinions. Learn a shell first, choose the one that you can get someone to answer your questions one on one in person. Best is some Bourne like shell which will be good for scripting and interactive use. Next learn your basic unix commands as are found in "Unix in a Nutshell." This includes awk and sed. Then decide if you want to learn C, then Perl and the other stuff. Perl is too cryptic to learn initially, and awk and sed are much more straughtforward, as is C (C++ is harder to master). So much for some initial thoughts. Chuck Demas -- Eat Healthy | _ _ | Nothing would be done at all, Stay Fit | @ @ | If a man waited to do it so well, Die Anyway | v | That no one could find fault with it. demas@theworld.com | \___/ | http://world.std.com/~cpd |
| |||
| Alan Connor <zzzzzz@xxx.yyy> wrote in message news:<JH%lb.3593$wc3.2929@newsread3.news.pas.earth link.net>... > On Fri, 24 Oct 2003 01:22:25 +0000 (UTC), Gregory L. Hansen <glhansen@steel.ucs.indiana.edu> wrote: > > > > > > > > When I read about Unix tools there seems to be a lot of overlap between > > them, like > > > > shells > > awk > > sed > > Perl > > Python > > C > > tcl/tk > > Java > > Lisp > > > > What's a beginner to do that can only learn one at a time? If I learn > > Perl, is there any reason at all to look at awk and sed? What does Python > > do that Perl doesn't? I like the thought of the C/tcl/tk combination, > > e.g. a simple way to put a graphical interface on my C apps, or so the > > legends go, but has Java made that obsolete? What does anyone use Lisp > > for? > > > > Please share some opinions. > > > > > > The shell is a command interpreter which stands between you and the kernel. > > Sed is an editor, the rest are programming languages with various focusses, > or, in the case of C, a general language. > > The shell includes a high-level and immensely practical programming language, > and you would be very wise to learn an sh-compatible shell like bash or zsh, > before tackling any of the other languages. > > And then, once you have a handle on 'sh', skip the rest and go for broke: > learn C, (which most of the others are written in :-) > > Learn the stream editor sed because it is very, very useful. The "Advanced Bash Scripting Guide" available at tldp.org is worth reading. It has many commented scripts. Walt R. |
| |||
| On 23 Oct 2003 21:46:42 -0700, Walt R <wmreinemer@tns.net> wrote: > > > Alan Connor <zzzzzz@xxx.yyy> wrote in message news:<JH%lb.3593$wc3.2929@newsread3.news.pas.earth link.net>... >> On Fri, 24 Oct 2003 01:22:25 +0000 (UTC), Gregory L. Hansen <glhansen@steel.ucs.indiana.edu> wrote: >> > >> > >> > >> > When I read about Unix tools there seems to be a lot of overlap between >> > them, like >> > >> > shells >> > awk >> > sed >> > Perl >> > Python >> > C >> > tcl/tk >> > Java >> > Lisp >> > >> > What's a beginner to do that can only learn one at a time? If I learn >> > Perl, is there any reason at all to look at awk and sed? What does Python >> > do that Perl doesn't? I like the thought of the C/tcl/tk combination, >> > e.g. a simple way to put a graphical interface on my C apps, or so the >> > legends go, but has Java made that obsolete? What does anyone use Lisp >> > for? >> > >> > Please share some opinions. >> > >> > >> >> The shell is a command interpreter which stands between you and the kernel. >> >> Sed is an editor, the rest are programming languages with various focusses, >> or, in the case of C, a general language. >> >> The shell includes a high-level and immensely practical programming language, >> and you would be very wise to learn an sh-compatible shell like bash or zsh, >> before tackling any of the other languages. >> >> And then, once you have a handle on 'sh', skip the rest and go for broke: >> learn C, (which most of the others are written in :-) >> >> Learn the stream editor sed because it is very, very useful. > > > The "Advanced Bash Scripting Guide" available at tldp.org is > worth reading. It has many commented scripts. > > Walt R. A great document, but starting with one of the free on-line tutorials, and asking the folks at comp.unix.shell to help you out when you get stuck, is a very good idea. -- Alan C Post validation at http://tinyurl.com/rv0y |
| |||
| glhansen@steel.ucs.indiana.edu (Gregory L. Hansen) writes: > When I read about Unix tools there seems to be a lot of overlap between > them, like > > shells awk sed Perl Python C tcl/tk Java Lisp > > What's a beginner to do that can only learn one at a time? Get a book that shows you a walk around all of these (particularly the first half; I'm sure there are some `unix programming' type things out there). > If I learn Perl, is there any reason at all to look at awk and sed? Yes. They're smaller and quicker; I'd prefer to pipe something through awk '{print $3}' rather than the corresponding Perl. > What does Python do that Perl doesn't? Has a totally different OO model, a different syntax, ... read <http://www.python.org/>, there are some docst there (somewhere!). > I like the thought of the C/tcl/tk combination, e.g. a simple way to put > a graphical interface on my C apps, or so the legends go, but has Java > made that obsolete? It's one way to go; the most canonical Java systems have dubious licensing constraints and are not well ported to all OSs. If you're into scripting, you might want to do a language comparison involving ruby, python, tcl and perl; there's no harm in knowing (for example) how to generate an image-thumnail directory listing in each of them, or something similar. > What does anyone use Lisp for? Well, I use the Scheme dialect for a few things - anything where I think a clean functional approach will benefit. See <http://www.lisp.org>, <http://www.schemers.org/>. And, of course, my "editor" is emacs, which is written in emacs lisp... ~Tim -- A big sky above me, |piglet@stirfried.vegetable.org.uk West winds blow. |http://spodzone.org.uk/ |
| |||
| In article <bna4r2$e99$1@pcls3.std.com>, Charles Demas <demas@TheWorld.com> wrote: >In article <bn9ush$j0e$3@hood.uits.indiana.edu>, >Gregory L. Hansen <glhansen@steel.ucs.indiana.edu> wrote: >> >>When I read about Unix tools there seems to be a lot of overlap between >>them, like >> >> shells >> awk >> sed >> Perl >> Python >> C >> tcl/tk >> Java >> Lisp >> >>What's a beginner to do that can only learn one at a time? If I learn >>Perl, is there any reason at all to look at awk and sed? What does Python >>do that Perl doesn't? I like the thought of the C/tcl/tk combination, >>e.g. a simple way to put a graphical interface on my C apps, or so the >>legends go, but has Java made that obsolete? What does anyone use Lisp >>for? >> >>Please share some opinions. > >Learn a shell first, choose the one that you can get someone to >answer your questions one on one in person. Best is some Bourne >like shell which will be good for scripting and interactive use. > >Next learn your basic unix commands as are found in "Unix in a >Nutshell." This includes awk and sed. > >Then decide if you want to learn C, then Perl and the other stuff. > >Perl is too cryptic to learn initially, and awk and sed are much >more straughtforward, as is C (C++ is harder to master). > >So much for some initial thoughts. I actually have some familiarity with shells, less now than I did through disuse of most features besides starting up programs and sometimes piping them around. And I know C and C++, but I haven't used them much in a Unix context. And I have a fat Unix book that describes some of that stuff, like sed and awk but not Perl, that I plan to go through when I get Linux in my home. But Perl has been described as doing more than sed and awk together, removing the need to pipe things around between the two and the shell, so I wondered whether I even need to care about them. One thing I have in mind is a fairly elaborate e-mail filter that can keep tallies, filter on attachments, send notifications of spam deletions, recognize spoofed words like pe.n!s, which are things that slocal on my Sun shell account can't do, so off-hand Perl seemed like the one to use, based strictly on what I've read about it but no knowledge of it. At least one person likes Python for scientific programming, but I don't know if that does things that Perl doesn't, or makes the job especially easier than C or Fortran would. -- "Let us learn to dream, gentlemen, then perhaps we shall find the truth... But let us beware of publishing our dreams before they have been put to the proof by the waking understanding." -- Friedrich August Kekulé |
| |||
| On 10/24/2003 9:12 AM, Gregory L. Hansen wrote: <snip> > And I have a fat Unix book that describes some of that stuff, > like sed and awk but not Perl, that I plan to go through when I get Linux You could download cygwin (www.cygwin.org) while you're waiting... > But Perl has been described as doing more than sed and awk > together, removing the need to pipe things around between the two You never need to do pipe things between sed and awk since awk can do anything sed can do. In the context of sed/awk solutions: for small things that sed can do easily, only use sed, and for the rest only use awk. and the > shell, so I wondered whether I even need to care about them. One thing I > have in mind is a fairly elaborate e-mail filter that can keep tallies, > filter on attachments, send notifications of spam deletions, recognize > spoofed words like pe.n!s, which are things that slocal on my Sun shell > account can't do, so off-hand Perl seemed like the one to use, based > strictly on what I've read about it but no knowledge of it. No, procmail, formail and/or spamassasin are some tools for that job. Ed. |
| |||
| In article <3F99414A.5070803@Lucent.com>, Ed Morton <mortonAVOIDINGSPAM@Lucent.com> wrote: > > >On 10/24/2003 9:12 AM, Gregory L. Hansen wrote: ><snip> >> And I have a fat Unix book that describes some of that stuff, >> like sed and awk but not Perl, that I plan to go through when I get Linux > >You could download cygwin (www.cygwin.org) while you're waiting... A cygmac would actually be more useful to me. > >> But Perl has been described as doing more than sed and awk >> together, removing the need to pipe things around between the two > >You never need to do pipe things between sed and awk since awk can do anything >sed can do. In the context of sed/awk solutions: for small things that sed can >do easily, only use sed, and for the rest only use awk. Okay. > > and the >> shell, so I wondered whether I even need to care about them. One thing I >> have in mind is a fairly elaborate e-mail filter that can keep tallies, >> filter on attachments, send notifications of spam deletions, recognize >> spoofed words like pe.n!s, which are things that slocal on my Sun shell >> account can't do, so off-hand Perl seemed like the one to use, based >> strictly on what I've read about it but no knowledge of it. > >No, procmail, formail and/or spamassasin are some tools for that job. None of those exist on my Sun account, only slocal, and I don't have a lot of disk space there. And rolling my own would likely be more instructional, so I thought I'd give it a try. -- "Let us learn to dream, gentlemen, then perhaps we shall find the truth... But let us beware of publishing our dreams before they have been put to the proof by the waking understanding." -- Friedrich August Kekulé |
| ||||
| 2003/10/24, 10:12(-05), Ed Morton: [...] > You never need to do pipe things between sed and awk since awk > can do anything sed can do. [...] Not always. Even GNU awk can't do easily things that sed can do in one line. sed 's/\(.\)\1/2\1/3' replaces the third occurrence of two consecutive same chars 'X' with "2X" (may not work with some old seds). The same in awk: awk '{ line=$0; l=length; n=3; o="" for (i=1;i<=l;i++) { c=substr($0,i,1); if (c == o) { if (!--n) { line=substr($0,1,i-2) "2" substr($0, i) break } o="" } else o=c } print line}' gawk '{print gensub(/(.)\1/,"2\\1",3)}' doesn't work. There's no equivalent for 'y' in awk. -- Stéphane ["Stephane.Chazelas" at "free.fr"] |