Should I learn bash scripting or is it going obsolete?

Hi folks,

I'm a CS students enrolled in a sysadmin class where we've been covering bash scripting for the past few weeks. I have prior knowledge in java, c++, c#, python,and some scripting languages like asp.net w/c# and php. This bash stuff seems pretty neat and a bit different than what I am used to. However, is it worth it in the long run? One of my other profs mentioned that he's not sure why they are teaching bash scripting in this class and that "python will replace bash scripts". I'm not concerned whether if someone thinks python is better. That sounds subjective.

So the question is - Is it worth the time and effort to learn bash scripts? Are these popular in the enterprise environment such as say on a job? Or am I just investing time into something obsolete that will become obsolete in the not too distant future?

Sorry if this is a report. I used the search but could not come up with any decent conclusion.

It depends on where you are going to work and on which domain.
If you have any idea on that probably we can suggest.

Well I'm thinking most likely in a corporate environment. I do realize many corporations will use technologies that are obsolete (i.e. why IE6 won't die).

This question is almost too good: "Hm... I could go to unix.com and ask whether a fundamental underpinning of UNIX systems is obsolete and should give forth before the windows brigade... Eh, a bit too obvious. I know -- ask that about an unusual shell, one that divides the community, in a manner that suggests I believe it's all shell scripting! The nerd rage will be hysterical!"

I'll be generous and assume you're not trolling. Is BASH obsolete? No. Is it for the things you use C# or Python for? Also no.

Scripting is somewhere between difficult and useless on a Windows machine because there are so many unscriptables(awkward, undocumented, or impossible). A program as simple as "cdrecord -dao cd_image.iso && /sbin/poweroff" (i.e. burn a cd, then turn off the computer) in UNIX might, in Windows, need an entire development environment, plus peering into undocumented OLE hell to figure out how (if at all!) your favorite CD burning program tells the computer whether burning completed successfully. Ever had to type in the same thing, or closely related things, 37 seperate times? Ever had to repetitively copy/paste data from one program into another because you can't just tell one to read from the other? Ever had to sit and wait for the computer to finish just so you can tell it to do something you wanted it to do all along? That's the kind of automatic tasks shell scripting and pipes are for. They join entire programs together at a very high level, if they're equipped to communicate that way; most UNIX programs are, most Windows ones aren't.

You should learn shell scripting, not just "bash scripting". BASH is just one shell. Learn how to program in a general Bourne shell and you can program in BASH, SH, and KSH the same way, and know what features BASH has and SH doesn't.

That certainly used be the case on Windows. With the introduction of PowerShell 2 that is no longer the case. PS2 is an excellent object-orientated shell with access to all the Windows functionality. It fact, Unix shells could learn a few tricks from PS2.

you're lucky to have bash scripting in your school.
we don't have in my country.. i just learn thru asking here.

our school don't even encourage learning unix. crap!

i won't bother learning if it won't matter. automating things using shell scripts really is awesome

Is it capable of interacting with a program that doesn't have the special hooks to do so?

wait so you cant use python within linux to substitute shell scripting? i wasnt referring to windows at all...

Python is not a shell, no.

You can use pipes in Python, much the same way you use pipes in C -- doing everything yourself, creating processes and creating pipes and redirecting file descriptors explicitly all the time, step by painful step.

Python has instead become a twelve-ton all-singing all-dancing do-everything language with every possible feature nailed to the side so you theoretically don't need an efficient way to use anything outside Python, with the side-effect that it opens hundreds of files to do nothing at all, much like Perl, Java, and .Net have done. It even has expansion modules to just call a proper UNIX shell.

yes, of course.