If you look into the history of perl, you'll find that it was written because awk(1) and sed(1) ran out of steam. They're not bad languages and I use them a lot. But Perl does much, much more. It's also vastly more extensible.
The other reason is that Things can often be much simpler to do in Perl than in awk or sed. It all depends upon which modules you use.
* It forks another process to work that could easily be done inside perl itself. This makes your perl script much faster.
* He used a string instead of a list in the system() call. This is a potential security risk and slows tbings down even more because the shell must be invoked instead of the program being executed directly by perl.
* He didn't use s2p(1) to create the perl script. Larry write it for a reason!
I saw a similiar piece of code where I work recently that spawned 3 separate copies of mkdir, separately. And Perl has a builtin mkdir() function. Needless to say, this error was corrected.
On the other hand a more complicated syntax doesn't make it any easier to program in either, as Perl has shown us.
Yay Python.:-)
-Dom
Re:PSH - because perl is a "real" language
on
To Z Or Not To Z
·
· Score: 1
There's a damned good reason why it shouldn't be used interactively, and it's the same one that means you wouldn't want a COBOL shell. There's just too much syntax. It gets in the way of typing in commands quickly and efficiently.
A shell has different requirements to a programming language, don't get them confused (even though they cross over a little bit).
-Dom
Re:Top 10 reasons for usung Z-Shell
on
To Z Or Not To Z
·
· Score: 1
precmd() is nice, but unfortunately, it doesn't allow you to modify the command before zsh actually executes it. It might not be precmd(), but a similiar function, I can't remember. But it's very annoying because it lets you write a function that takes URL on the command line, but then you get an error after you've processed it.
tcsh is a dog. Whilst it's got some nice features, it still uses all that godawfull csh syntax. Try zsh, get a real shell syntax (that lets you type a for loop on one line).
One of the really, really nice things about Python is the embedding interface. It's really easy to embed Python in your C/C++ code. It's also a very stable interface.
Anybody who has ever worked with XS will know what I mean!
If you're interested in quantum computing, try to check out Damian Conway's talk on the Perl module Quantum::Superpositions. It's very funny and actually quite useful!
Damian is travelling around the world talking to perl user groups. Check out his schedule to see if he's due to talk near you.
Just curious, what caused you to migrate from FreeBSD to Linux. I would have thought that FreeBSD (with softupdates) would have been the better choice...
Damn right that news abuses the filesystem. Why do you think that products with cyclical file systems for news overtook INN a while back until they developed their own?
Mind you, with reiserfs, it may become feasible to do the "one article per file" thing again.
1) Bash is not a clone of ksh. It's an independent implementation of the POSIX standard for unix shells. (It's actually a superset).
2) ksh does support the arrow keys, it just doesn't come set up that way (in ksh88, which most people seem to relate to). Ksh93 comes set up to use arrow keys, I think.
How do you feel that ksh holds up for web programming? I have always enjoyed programming shell scripts more than anything else, but I have always been unhappy with the shell idioms for parsing securely and correctly (the myriad of substitution operators is a nightmare to control). This is one area in which Perl has really taken the lead. How do you think shell programming could be better adapted for the web?
Also, how do you feel about most commercial Unix vendors (and projects like pdksh) that are still shipping ksh88 as the default, 13 years later? ksh93 has many more useful features, but the takeup has been slow.
I see that nobody has mentioned the BSD source trees yet. All the BSDs (and NetBSD in particular) have some of the cleanest, simplest source code I have seen (barring/usr/src/contrib/, which is imported).
It may not be earth shattering stuff, but every time I have needed to modify the source code to FreeBSD, it has been a delight to see how good the code is.
Check out an unpacked source tree at ftp://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current/ src
What happens if ReiserFS *can't* recover for some reason? You don't stand a cat's chance in hell of getting anything back. Try using more than one partition.
Well, it sounds like you are yearning to try out the Z Shell. While it's not as simple as you'd like it does have enough features that make problems like the above go away. And it's not csh or tcsh, which is good.
For instance, instead of using find, you have the option to use "recursive globbing". So you can grep through all the include files by doing:
Hey! That's *exactly* what cisco want! A reason to sell router upgrades to customers!
-Dom
You need Perl 6. Please stay tuned.
If you look into the history of perl, you'll find that it was written because awk(1) and sed(1) ran out of steam. They're not bad languages and I use them a lot. But Perl does much, much more. It's also vastly more extensible.
The other reason is that Things can often be much simpler to do in Perl than in awk or sed. It all depends upon which modules you use.
-Dom
It's braindead because:
* It forks another process to work that could easily be done inside perl itself. This makes your perl script much faster.
* He used a string instead of a list in the system() call. This is a potential security risk and slows tbings down even more because the shell must be invoked instead of the program being executed directly by perl.
* He didn't use s2p(1) to create the perl script. Larry write it for a reason!
I saw a similiar piece of code where I work recently that spawned 3 separate copies of mkdir, separately. And Perl has a builtin mkdir() function. Needless to say, this error was corrected.
-Dom
"Linux is only free if your time has no value." -- jwz
Boy, was he right. Look at how much time it takes to get things working. It's not as free as it looks.
And don't tell me that MS software is worse. It is. But it's indicative of software as a whole.
-Dom
Who cares? When the games dry up, try and get NetBSD running on it instead and get some use out of it.
-Dom (thinking about buying one)
On the other hand a more complicated syntax doesn't make it any easier to program in either, as Perl has shown us.
:-)
Yay Python.
-Dom
There's a damned good reason why it shouldn't be used interactively, and it's the same one that means you wouldn't want a COBOL shell. There's just too much syntax. It gets in the way of typing in commands quickly and efficiently.
A shell has different requirements to a programming language, don't get them confused (even though they cross over a little bit).
-Dom
precmd() is nice, but unfortunately, it doesn't allow you to modify the command before zsh actually executes it. It might not be precmd(), but a similiar function, I can't remember. But it's very annoying because it lets you write a function that takes URL on the command line, but then you get an error after you've processed it.
-Dom
tcsh is a dog. Whilst it's got some nice features, it still uses all that godawfull csh syntax. Try zsh, get a real shell syntax (that lets you type a for loop on one line).
-Dom
One of the really, really nice things about Python is the embedding interface. It's really easy to embed Python in your C/C++ code. It's also a very stable interface.
Anybody who has ever worked with XS will know what I mean!
-Dom
If you're interested in quantum computing, try to check out Damian Conway's talk on the Perl module Quantum::Superpositions. It's very funny and actually quite useful!
Damian is travelling around the world talking to perl user groups. Check out his schedule to see if he's due to talk near you.
Just curious, what caused you to migrate from FreeBSD to Linux. I would have thought that FreeBSD (with softupdates) would have been the better choice...
-Dom
Damn right that news abuses the filesystem. Why do you think that products with cyclical file systems for news overtook INN a while back until they developed their own?
Mind you, with reiserfs, it may become feasible to do the "one article per file" thing again.
-Dom
Say, what license was that again? Are you *sure* you're allowed to use it?
-Dom
Don't forget that NetBSD is starting down the road to SMP now, too.
Also, NetBSD has had an improved VM system for some time now. I think it's the default on i386, but I can't say for certain.
-Dom
1) Bash is not a clone of ksh. It's an independent implementation of the POSIX standard for unix shells. (It's actually a superset).
:-)
2) ksh does support the arrow keys, it just doesn't come set up that way (in ksh88, which most people seem to relate to). Ksh93 comes set up to use arrow keys, I think.
3) bash ain't nowhere near as cool as zsh.
-Dom
It comes with Solaris 8, but that's a very recent addition. Mind you, Solaris 8 also comes with zsh, which knocks bash into a cocked hat!
-Dom
I very much doubt that this would be the case, given that the pdksh team are aiming at a version that is 13 years old. :-)
How do you feel that ksh holds up for web programming? I have always enjoyed programming shell scripts more than anything else, but I have always been unhappy with the shell idioms for parsing securely and correctly (the myriad of substitution operators is a nightmare to control). This is one area in which Perl has really taken the lead. How do you think shell programming could be better adapted for the web?
Also, how do you feel about most commercial Unix vendors (and projects like pdksh) that are still shipping ksh88 as the default, 13 years later? ksh93 has many more useful features, but the takeup has been slow.
Thanks,
-Dom
I see that nobody has mentioned the BSD source trees yet. All the BSDs (and NetBSD in particular) have some of the cleanest, simplest source code I have seen (barring /usr/src/contrib/, which is imported).
/ src
It may not be earth shattering stuff, but every time I have needed to modify the source code to FreeBSD, it has been a delight to see how good the code is.
Check out an unpacked source tree at ftp://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current
-Dom
A 15Gb root partition? Are you totally nuts?
What happens if ReiserFS *can't* recover for some reason? You don't stand a cat's chance in hell of getting anything back. Try using more than one partition.
-Dom
Qmail has one major problem. DJB. Oh, and the license for qmail makes it non-free software.
You'd probably be far better off looking at postfix, which is simpler to configure than qmail, and just as fast, reliable and secure.
-Dom
According to Knuth, the correct term is email. And I for one don't feel comfortable disagreeing with Knuth.
Well, it sounds like you are yearning to try out the Z Shell. While it's not as simple as you'd like it does have enough features that make problems like the above go away. And it's not csh or tcsh, which is good.
For instance, instead of using find, you have the option to use "recursive globbing". So you can grep through all the include files by doing: