Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

Recently I was looking at python's shutil and subprocess etc... And I started wondering: wouldn't it be ok to use python instead of e.g. bash?

What am I missing?

share|improve this question

marked as duplicate by gnat, Martijn Pieters, thorsten müller, Bart van Ingen Schenau, Kilian Foth Apr 15 '13 at 9:20

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

You can replace bash with iPython I believe – Chris Montanaro Jan 23 '13 at 7:42
See also Object-oriented shell for *nix – Gilles Jan 23 '13 at 18:55
up vote 9 down vote accepted

Convenience of syntax, mostly.

In python, running a process requires; renaming a file shutil.move(), etc. Bash syntax is much more direct for those tasks.

Yes, Python is a great language, but the explicit syntax to execute (for bash) simple tasks is going to get in the way of doing day-to-day work real fast.

share|improve this answer
2 – Ismail Badawi Jan 9 '13 at 18:50
@isbadawi: exactly; adding a powerful module helps improve the convience levels of course! But if we are looking at just python, then those same tasks are going to be (a lot) more cumbersome. – Martijn Pieters Jan 9 '13 at 18:53
@Izkata: verbose/cluttered is a relative thing. I find doing almost any type of serious programming in bash to be like getting a root canal without anesthesia. (And I say that having been at a shell prompt since 1980.) Bash still is forking subprocesses just like Python, so it doesn't seem to have any inherent advantage other than 3 decades of inertia. – Peter Rowell Jan 10 '13 at 6:45
Here's the latest Internet Archive of this question: Why are scripting languages (e.g. Perl, Python, Ruby) not suitable as shell languages? – Blaz Sep 8 '15 at 14:04

Not the answer you're looking for? Browse other questions tagged or ask your own question.