I normally code admin scripts in Python and I know of many that code them in Perl. I was about to invest some time on improving my skills on bash programming. But I wonder if people around think that this is a good idea ?
I know bash is a good skill to have and market very often demand it but ... if I can get by with Python or Perl then ... is it really worth the effort ?
As answers I am looking for cases where actually bash is way better than Perl or Python to develop admin scripts.
Bash is a Unix shell and command language which is commonly used for system administration tasks whereas Python/Perl/Ruby is used for general-purpose programming. But all of these can handle all kind of problems and all have different strengths over the rest.
Python can be a simple link in the chain. Python should not replace all the bash commands. It is as powerful to write Python programs that behave in a UNIX fashion (that is, read in standard input and write to standard output) as it is to write Python replacements for existing shell commands, such as cat and sort.
Bash is tough to write and not powerful as python. It is specially designed for web and app development. It is found on Linux distributions and macOS. Python is more efficient and is known for its consistency and readability.
Python is also a great language for short scripts and web development, and it's generally better supported than Perl. While a great Perl programmer should be able to do anything a great Python programmer can do, it will be more difficult for them because fewer tools and utilities are available.
Anything you learn can only benefit you, never is it a bad idea to learn something. That said, if you feel you're productive with Python then I don't see why you would need bash. Python is more powerful (being a full blown programming language) and IMO has a nicer, more readable syntax. Bash is often useful for quick and dirty scripting, though.
If you do decide to learn it, here are some resources to get you started:
Although some rules-of-thumb are occasionally thrown in the air regarding when you should use each, I think you'll figure it out once you get to know all of your options. Having another tool in your arsenal is always an advantage.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With