Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python and/or Perl VS bash [closed]

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.

like image 873
webDevelSouth Avatar asked Jan 15 '11 19:01

webDevelSouth


People also ask

Which is better Bash or Perl?

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.

Is Python replacing Bash?

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.

Which is better Bash script or Python?

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.

Which is better Python or Perl?

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.


1 Answers

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:

  1. A Bash guide for beginners
  2. The magnificent Bash FAQ
  3. Common Bash Pitfalls

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.

like image 191
drrlvn Avatar answered Oct 17 '22 12:10

drrlvn