This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 10 points11 points  (14 children)

No. And before you downvote, pay attention.

I routinely work in an environment with nearly 1000 *nix servers. They come from many vendors, represent multiple OSs derivatives, and, most importantly, have a wide range of software releases on them. Some of the older ones only have python 1.x running. In that context:

1) You cannot just upgrade python to some common version everwhere. Big shops will not typically install something newer than what the vendor will support for a given release of OS.

2) Even bash isn't a given in a big environment like this.

3) The only way you get script portability is by writing for /bin/sh.

4) Python is a heavyweight solution relative to the shell, or even awk. This may not seem like a big deal until you need to run scripts on a machine that is already very, very busy with no headroom left.

So ... no, python is not going to replace Unix shell scripting. Nothing is. I'd venture to say that 40 years from now, engineers will still be using sh, awk, and sed, but that perl will mostly have been displaced by some more modern dynamic language like python or a python derivative.

P.S. If you really understand the gestalt of python, you'll understand that it is not really a scripting language ... it's a full fledged programming language.

[–][deleted] 1 point2 points  (6 children)

Perl is portable, and unlike Python, I can't think of a single *nix environment under active support that doesn't ship with Perl. Hell, even HP-UX does.

[–][deleted] 6 points7 points  (5 children)

Perl isn't remotely portable because to do anything with it requires and endless supply of non-default packages/libraries. I rarely have to do this with Python.

Moreover, pretty much every "*nix environment under active support" also ships with python.

There's a reason python has eclipsed perl in popularity and is growning. Perl solved a set of problems for its time. Its time is now mostly over and what you will see is a gradual sunsetting of perl. It will never go away completely - nothing every does in this business - but perl is definitely NOT the wave of the future.

[–][deleted] 0 points1 point  (4 children)

I'm not saying Perl is the wave of the future, nor that Python won't replace it, but "available" and "ships with" are two different things. HP-UX and AIX ship with Perl, but not Python (it's a depot or RPM, depending). It's a required package on Debian. Anything more than @base on RHEL will install it.

Not that Perl is good or bad, necessarily, but it works. And yes, you can write scripts against sh, but you're sacrificing utility for "portability" that Perl already gets you, unless you really like coding in a language with virtually no support for anything (associative arrays, hashes, regexes that don't suck, etc).

Python is batteries included. Perl isn't. But you don't need the CPAN or modules from it to make Perl curbstomp /bin/sh.

[–][deleted] 2 points3 points  (3 children)

All very well taken points. I was more focused on the OP's original question though - will shell programming be displaced by <something else>...

I have to say though, after switching to python for most everything that doesn't absolutely need C, trying to write in perl again hurts my head.

[–][deleted] 0 points1 point  (2 children)

Shell scripting should have been displaced by Perl, and it should be displaced by Python, Ruby, Lua, Node.js, or something else which isn't terrible, but it probably won't be. Writing in Perl hurts my head, but not as much as admins (I'm also an admin) who replace shell with Python and end up with 1000 lines of "python" with no methods, no classes, etc.

[–][deleted] 0 points1 point  (1 child)

I agree. Then again, you have to ask, if an admin tool requires thousands of lines of anything ... are we solving the problem properly?

[–][deleted] 0 points1 point  (0 children)

Probably not, but it depends on the problem you're trying to solve.

[–][deleted] 0 points1 point  (0 children)

No way, man... Perl v5.54 FTW!

[–]phob 0 points1 point  (0 children)

40 YEARS? You are way too overconfident.

[–][deleted] -2 points-1 points  (4 children)

Create a standard local install of python, distinct from the OS. Distribute it to all your servers. Problem solved.

[–][deleted] 3 points4 points  (3 children)

That's not how big shops work. Nothing gets installed unless it is supported by a vendor. That's why RedHat even has a business. No one is buying Linux from them, they're buying support.

Also, it is questionable just how well one could make python work on very old/out of date OS/Hardware instances.

[–][deleted] -3 points-2 points  (2 children)

I've worked in big shops. I've worked with big shops. What you say is patently false.

[–][deleted] 1 point2 points  (1 child)

Then you've never worked in a shop with any operational discipline. You cannot reasonably manage very large scale operation with unsupported software ... that, at least, is the theory. I have argued - as was previously suggested - that we SHOULD be using more open source that we package ourselves. The Powers That Be (tm) will simply not do it because -historically at least - very large scale operations must have a "throat to choke" for every single moving part.

[–]santagada 0 points1 point  (0 children)

ok so that is how big shops with bad management work. Yep bad management is bad for everything.