Live data from Hacker News

Command line tools for the novice

andymatthews.net

11–20 of 59 posts

Re: Command line tools for the novice

#11

I've wanted to try zsh for a long time now, but I worry about the mental context switching I'll have to do when developing locally and then ssh'ing into another server to perform other tasks (servers, I should add, where I can't install zsh). Is anyone in a similar situation? If you switched, was it worth it?

zsh can mostly be thought of as a collection of enhancements to bash, so I find that rather than changing my thought process, I just try to use a zsh feature, realize it's not working, and do it the crummy bash way instead. If a feature exists in bash, the zsh syntax is usually identical.

Also just for the record zsh is installed by default on many OSes, including OSX, so you might be surprised to learn that some of your servers already have it.

Re: Command line tools for the novice

#12

I've wanted to try zsh for a long time now, but I worry about the mental context switching I'll have to do when developing locally and then ssh'ing into another server to perform other tasks (servers, I should add, where I can't install zsh). Is anyone in a similar situation? If you switched, was it worth it?

I switched cold turkey from bash to zsh a few months ago, and going back to bash on servers hasn't been a problem. In my experience, if you've used bash for a long time you don't forget it.

Minor tip - you can use the same .aliases file for both shells, I just source it in .bashrc and .zshrc on my dev machine. So if I ever need to switch to bash for some reason, my most used aliases are still available.

If you switch, don't forget oh-my-zsh [1].

1. https://github.com/robbyrussell/oh-my-zsh

Re: Command line tools for the novice

#13

I've wanted to try zsh for a long time now, but I worry about the mental context switching I'll have to do when developing locally and then ssh'ing into another server to perform other tasks (servers, I should add, where I can't install zsh). Is anyone in a similar situation? If you switched, was it worth it?

I switched cold turkey from bash to zsh a few months ago, and going back to bash on servers hasn't been a problem. In my experience, if you've used bash for a long time you don't forget it. Minor tip - you can use the same .aliases file for both shells, I just source it in .bashrc and .zshrc on my dev machine. So if I ever need to switch to bash for some reason, my most used aliases are still available. If you switch…

I'm actually not very taken with oh-my-zsh. It seems to add a layer of complexity while not really adding anything you couldn't just paste into your .zshrc. If it eliminated tinkering overhead that would be one thing, but in my experience it just gave me a new layer of software that needed tinkering.

Re: Command line tools for the novice

#14

I've wanted to try zsh for a long time now, but I worry about the mental context switching I'll have to do when developing locally and then ssh'ing into another server to perform other tasks (servers, I should add, where I can't install zsh). Is anyone in a similar situation? If you switched, was it worth it?

I've been on zsh for ages, and the thing that always kills me dead when stuck in bash is the terrible default command line editor. Whereas in zsh, if I go back to edit a multi-line loop or something, it preserves the white-space, bash by default presents the commands as a semicolon delimited list on one line. That's ass. Is there a handy bash shortcut to mimic zsh's behavior here?

Re: Command line tools for the novice

#15
post #14

I've wanted to try zsh for a long time now, but I worry about the mental context switching I'll have to do when developing locally and then ssh'ing into another server to perform other tasks (servers, I should add, where I can't install zsh). Is anyone in a similar situation? If you switched, was it worth it?

I've been on zsh for ages, and the thing that always kills me dead when stuck in bash is the terrible default command line editor. Whereas in zsh, if I go back to edit a multi-line loop or something, it preserves the white-space, bash by default presents the commands as a semicolon delimited list on one line. That's ass. Is there a handy bash shortcut to mimic zsh's behavior here?

How I wish there was a better language for interacting with Unix command line utilities than the godawful POSIXy shells.

Re: Command line tools for the novice

#16

I've wanted to try zsh for a long time now, but I worry about the mental context switching I'll have to do when developing locally and then ssh'ing into another server to perform other tasks (servers, I should add, where I can't install zsh). Is anyone in a similar situation? If you switched, was it worth it?

As someone who's converted from bash -> fish (arguably a much bigger context switch as fish isn't bash compatible) I haven't found this to be an issue.

Re: Command line tools for the novice

#17
Tools similar to z:

1. [Autojump](https://github.com/joelthelion/autojump), first implementation and what z was based on, written in python. Functionality similar to z.

2. [Fasd](https://github.com/clvv/fasd), feature-rich fork of z, support for files, support for more shells and platforms (BSDs, Android).

Re: Command line tools for the novice

#18
post #15
post #14

Earlier quoted context omitted.

I've been on zsh for ages, and the thing that always kills me dead when stuck in bash is the terrible default command line editor. Whereas in zsh, if I go back to edit a multi-line loop or something, it preserves the white-space, bash by default presents the commands as a semicolon delimited list on one line. That's ass. Is there a handy bash shortcut to mimic zsh's behavior here?

How I wish there was a better language for interacting with Unix command line utilities than the godawful POSIXy shells.

Try Tom Duff's rc shell: http://rc.cat-v.org

Is available on *nix systems as part of Plan 9 from User Space: http://plan9.us

Re: Command line tools for the novice

#19
post #18
post #15

Earlier quoted context omitted.

How I wish there was a better language for interacting with Unix command line utilities than the godawful POSIXy shells.

Try Tom Duff's rc shell: http://rc.cat-v.org Is available on *nix systems as part of Plan 9 from User Space: http://plan9.us

Interesting. I'll give it a go.

I've tried living in iPython and eshell, and while I prefer python or lisp as a programming language to almost anything, neither is nearly as quick and dirty as sh for doing stuff with stdin/out from a pipeline of tools. I don't quite know what a better language than sh would look like, but a man can dream.

Also, universe, if you're going to get on fixing the sh problem, can we restructure how the shell operates entirely? Don't do argument expansion! This is one area where the Unix Haters got it really right.

Re: Command line tools for the novice

#20
post #19
post #18

Earlier quoted context omitted.

Try Tom Duff's rc shell: http://rc.cat-v.org Is available on *nix systems as part of Plan 9 from User Space: http://plan9.us

Interesting. I'll give it a go. I've tried living in iPython and eshell, and while I prefer python or lisp as a programming language to almost anything, neither is nearly as quick and dirty as sh for doing stuff with stdin/out from a pipeline of tools. I don't quite know what a better language than sh would look like, but a man can dream. Also, universe, if you're going to get on fixing the sh problem, can we restruc…

Please define "argument expansion".
Post reply on HN