It's not. The reasons that one might use `plumbum` are similar to the reasons that one might use `fabric` instead of just running local/remote shell scripts, i.e.
- Ability to leverage the richness of Python to pre/post-process the inputs/outputs from other shell commands.
- Easier to parameterise and maintain.
- Familiarity with Python over the likes of bash, zsh, etc.
It's definitely not, until you need to access the stdout of that command programmatically. Plumbum replaces the subprocess module (and os.system etc.), not shell scripts, despite their motto. It might displace shell scripts, because once you can use lists, maps, functions with actual arguments, etc. why would you go back? But it's not going to replace shell one-liners any time soon.
you probably didn't want the "& FG" part, as it would go to the screen and run "in the foreground", e.g., make you wait. but anyway, as other people have said, it aims at providing an object oriented replacement for shell scripts, etc.
This is not an object-oriented replacement for shell scripts. This is a shell script DSL embedded in Python.
If you want to use Python to manipulate the input or output of shell commands, then write a Python script that reads from stdin and writes to stdout, and use the shell to insert that script into the appropriate point in your command chain. It's the UNIX way.
I'm sure it's convenient, but I wouldn't call this kind of operator overloading "pythonic".
Not to say being pythonic is always better, but some of these tricks don't even seem that practical. Why "& FG" instead of .fg()? Using division for joining paths is cute, but why not use '+', the conventional append operator?
This reminds me of when I first saw drop-box: Immediate recognition of the pain it will save me. I often hack up kludges that approximate this -- os.system calls that pipe to a file, then I read and parse the file. Good work.
I think this attempt and other simile are fun but I doubt I would use them for serious things. Maybe it should be done the other way: like markdown is an extension of html, we could have an extension of shell with python syntax.