Live data from Hacker News

Xonsh, a Python-ish, Bash-compatible shell language and command prompt

xonsh.org

41–50 of 63 posts

Re: Xonsh, a Python-ish, Bash-compatible shell language and command prompt

#41

I'm a lead dev on the fish shell ( http://fishshell.com ) xonsh looks very cool. Shell scripting languages are famously obtuse and underpowered, and we've thought about how to cleanly merge shell scripting with a real language. It's heartening to see an attempt at it. Ambiguous syntax is a sticking point. For example, say the user runs this: [ 1 ] is this constructing a Python list with the value 1, or is it invoking…

> Shell scripting languages are famously obtuse and underpowered, and we've thought about how to cleanly merge shell scripting with a real language. It's heartening to see an attempt at it.

I used tclsh for a while. IMO a shell language needs the "function arg1 arg2" function-application syntax to fit with the way programs are called. Fortunately that style seems to be getting more popular - Haskell does it and to a certain extent so does Scala.

Re: Xonsh, a Python-ish, Bash-compatible shell language and command prompt

#42

I'm a lead dev on the fish shell ( http://fishshell.com ) xonsh looks very cool. Shell scripting languages are famously obtuse and underpowered, and we've thought about how to cleanly merge shell scripting with a real language. It's heartening to see an attempt at it. Ambiguous syntax is a sticking point. For example, say the user runs this: [ 1 ] is this constructing a Python list with the value 1, or is it invoking…

> that leaves shell-integration scripts: virtualenv, rbenv, etc. Supporting that stuff is one of the most common requests that the fish shell gets, and one of the most commonly cited reasons for not using fish. shameless plug, but I made a utility to solve the problem: https://github.com/edc/bass So you can write `bass source /usr/local/bin/virtualenvwrapper.sh ';' mkvirtualenv env1`, which of course can be shortened…

I'm testing this out later this week... if it works... you're my new hero!

Re: Xonsh, a Python-ish, Bash-compatible shell language and command prompt

#43

I genuinely wish there was an alternative that could gain enough traction to reach critical mass and hopefully start shipping with operating systems. I've never bothered to learn bash because it was always so damned confusing, and I just couldn't get over the idiosyncrasies when playing around with it. I wouldn't mind putting in time to learn something new and actually user-friendly.

This is quite apropos, as just last week I released a little language called 'bish' designed to overcome exactly this issue. It compiles to bash for portability, but has more modern and familiar syntax.

See https://github.com/tdenniston/bish for the repo and https://news.ycombinator.com/item?id=9166386 for some previous discussion.

The language is still brand new and under active development. It's not stable yet.

Re: Xonsh, a Python-ish, Bash-compatible shell language and command prompt

#44
I see a lot of discussion on the awkwardness and idiosyncrasies of shells like bash.... So this is a great time for a shameless plug! Last week I released a language called 'bish' (https://github.com/tdenniston/bish) which compiles to bash, but has none of the same syntactical weirdness. So the idea is: write and maintain your script in bish, but compile to bash and ship the bash version.

Here (https://news.ycombinator.com/item?id=9166386) is the previous discussion from last week.

Re: Xonsh, a Python-ish, Bash-compatible shell language and command prompt

#45
post #34
post #26

So, for anyone like me who wanted to install it with pip, but has Python 2.7 as their default (and doesn't want to change for fear of breaking things), do the following (on a Debian based system): curl -O https://raw.githubusercontent.com/pypa/pip/master/contrib/ge... sudo python3.4 get-pip.py sudo mv /usr/local/bin/pip /usr/local/bin/pip3 # optional, adjust line below if ommited sudo pip3 install xonsh ------ then:…

For Debian/jessie it worked nicely for me to just install python3-ply and python3-pip with apt-get and then just do "pip3 install xonsh". Python3 seems to coexist just fine beside the default 2.7.

Somehow, python3-pip escaped me. I feel silly.

Re: Xonsh, a Python-ish, Bash-compatible shell language and command prompt

#46
post #26

So, for anyone like me who wanted to install it with pip, but has Python 2.7 as their default (and doesn't want to change for fear of breaking things), do the following (on a Debian based system): curl -O https://raw.githubusercontent.com/pypa/pip/master/contrib/ge... sudo python3.4 get-pip.py sudo mv /usr/local/bin/pip /usr/local/bin/pip3 # optional, adjust line below if ommited sudo pip3 install xonsh ------ then:…

On OSX I just installed it in a virtualenv with python3:

  brew install python3 # will install python3 but not make it default
  mkdir xonsh && cd xonsh
  virtualenv -p /usr/local/bin/python3 venv
  source venv/bin/activate
  pip install xonsh
  xonsh

Re: Xonsh, a Python-ish, Bash-compatible shell language and command prompt

#47
post #15

Earlier quoted context omitted.

Read it, yes. Appreciate it, no.

I'd readily accept any new demo videos :) Just use a white background so it matches the website theme

Is there a reason xonsh doesn't honor the PS1 variable from bash to keep your terminal prefix? Or is there a way to customize xonsh's?

Example:

  10:54:01 foo@bar:~/scripts/xonsh$ xonsh
  foo@bar ~/scripts/xonsh $ # no time prefix

Re: Xonsh, a Python-ish, Bash-compatible shell language and command prompt

#48
post #47

Earlier quoted context omitted.

I'd readily accept any new demo videos :) Just use a white background so it matches the website theme

Is there a reason xonsh doesn't honor the PS1 variable from bash to keep your terminal prefix? Or is there a way to customize xonsh's? Example: 10:54:01 foo@bar:~/scripts/xonsh$ xonsh foo@bar ~/scripts/xonsh $ # no time prefix

If you go to [http://xonsh.org/tutorial.html#environment-variables] and scroll down to the table, you can see how to change the prompt :)

Re: Xonsh, a Python-ish, Bash-compatible shell language and command prompt

#50

I genuinely wish there was an alternative that could gain enough traction to reach critical mass and hopefully start shipping with operating systems. I've never bothered to learn bash because it was always so damned confusing, and I just couldn't get over the idiosyncrasies when playing around with it. I wouldn't mind putting in time to learn something new and actually user-friendly.

.. you say a shell command line should be user friendly? What kind of user would use command line? We are all bofhs here.

Also some of us are being paid to write bash scripts. I'm for example forced into bash because of AIX server. Learing bash is fun and profitable...

Post reply on HN