Hacker News new | ask | show | jobs
by pyedpiper 2830 days ago
Love xonsh!! And gets more and more stable with every release.

it's the shell I always wanted. And cross platform to boot.

Alias ls -l?

aliases['ls'] = "ls -l"

Oops no I don't want that any more:

del aliases['ls']

Add dir to path:

$PATH.append('/foo/bar')

Just the awesome python syntax sugar and readbility right in the

May I never right a bash script again.

2 comments

> May I never right a bash script again.

Bash is not going away any time soon, for better or worse..

del aliases[‘ls’] seems like a step back from unalias ls.
Only if you're coming from a different shell.

For me, it's easier to remember that aliases acts like a dictionary, so I can treat it like any other dictionary. With "unalias" I have to remember the command. As I rarely use unalias (a few times over a period of years), I typically have to search the web on how to remove an alias.

And if it really bothers you, I'm pretty sure it's trivial to define an unalias function in Xonsh that will act as you expect (without needing parentheses).

It's part of the beauty of Xonsh - many such commands you're used to can be brought into it by writing fairly simple Python code.

Sure, but aliases is a real mapping object that you can access and manipulate
no the point is that if you know Python, you know how to do it without looking it up