You can add options if what you use isn’t there. :)

  • wraptile
    link
    fedilink
    arrow-up
    5
    ·
    4 years ago

    Let me tell you about xonsh.

    It’s a modern full python programmable shell and it’s awesome! I’ve been using it for 2 years now and while it has some support issues having a full-blown python in your shell is just so convenient!
    There are lot of brilliant UNIX tools like grep, jq etc. however often I find myself in a place where I feel I could write 2 lines of python faster and easier than researching and messing around with processing tool such as jq — if you get this feeling than xonsh is the shell for you!

    Example of common use case, renaming files:

    $ ls                                                                                                                  
    bar.md  foo.md dir/gar.md
    $ for file in Path().glob('*'): $[mv @(file) @(file.name + '.bak')]                                                   
    $ ls                                                                                                                  
    bar.md.bak  foo.md.bak dir/gar.md.bak
    

    Here we glob through files recursively and suffix .bak to every one of them.

    Xonsh gives you a lot of flexibility in your shell and you should give it a go. There’s a web-based playground on https://xon.sh homepage that you can spin up to try xonsh hassle-free!

    • gaz
      link
      fedilink
      arrow-up
      1
      ·
      4 years ago

      Xonsh is great but it still doesn’t feel ready for production usage. I think you still can’t delete stuff from history which is a deal breaker for me.