Live data from Hacker News

Zsh is your friend.

mikegrouchy.com

61–70 of 117 posts

Re: Zsh is your friend.

#61

While from what I have read about it zsh is a nice shell, it doesn't deal with what I find to be the biggest problem with bash, sh, and just about every shell that isn't fish: the horribly ugly and inconsistent syntax. And I think it's rather sad that on what is supposedly the most advanced shell of our generation, you still have to deal with a thousand ridiculous redirections and quoting styles, different delimiter…

I have been using fish for several years now. It's community is a fraction of zsh, bash, and others, and I've tried to go back to them, mostly out of misplaced "everyone else is doing it" mindset Fish is a great shell. It's a modern shell, that uses colors, UTF, and processing power that didn't exist when the others were designed. I feel the best thing about it is the sane defaults and large number of prebuilt comple…

I feel that the days of a shell being used for scripting are past.

I've noticed this attitude among those who tend to use sysadmin-minimizing features of the internet, such as cloud hosting. There's still a whole world of real server out there, though.

Re: Zsh is your friend.

#62
post #61

Earlier quoted context omitted.

I have been using fish for several years now. It's community is a fraction of zsh, bash, and others, and I've tried to go back to them, mostly out of misplaced "everyone else is doing it" mindset Fish is a great shell. It's a modern shell, that uses colors, UTF, and processing power that didn't exist when the others were designed. I feel the best thing about it is the sane defaults and large number of prebuilt comple…

I feel that the days of a shell being used for scripting are past. I've noticed this attitude among those who tend to use sysadmin-minimizing features of the internet, such as cloud hosting. There's still a whole world of real server out there, though.

I get what you're saying but have to say that since I've started doing more deployments in AWS I'm writing more and more shell scripts. Any given Linux AMI will support Bash and even though shell scripts are painful to write and maintain, doing the equivalent in e.g. Python is painful as well :-(

Re: Zsh is your friend.

#63
post #61

Earlier quoted context omitted.

I have been using fish for several years now. It's community is a fraction of zsh, bash, and others, and I've tried to go back to them, mostly out of misplaced "everyone else is doing it" mindset Fish is a great shell. It's a modern shell, that uses colors, UTF, and processing power that didn't exist when the others were designed. I feel the best thing about it is the sane defaults and large number of prebuilt comple…

I feel that the days of a shell being used for scripting are past. I've noticed this attitude among those who tend to use sysadmin-minimizing features of the internet, such as cloud hosting. There's still a whole world of real server out there, though.

That is true. I do minimal system administration, so that is not a concern for me.

I tend to use a shell for system interaction more than scripting. In that regard, I give more importance to interactivity enhancements. On the other hand, I have found myself using bash to automate simple things in our company testbed. As soon as I need a datastructure more than an array, or recursive functions, I jump to lua.

If your primary job is to be a sysadmin, then Bash is Required Reading.

Re: Zsh is your friend.

#64

Earlier quoted context omitted.

Do you have to do anything weird to Lua to make it work as a system scripting language? Do you just use the built in OS interfaces?

Yes, I just use the builtin's. Basically os.execute, and io.popen. Popen is not the greatest because you can't get exit statuses from it. But for a quick script that is too messy in shell, it suffices. I believe that there is an extension to lua that has a popen that returns exit statuses. That can be used too. For pattern matching, I either pipe to perl and capture the output, or use the inbuilt pattern matching sys…

Since Lua 5.2 (just released) the pipe:close() method returns the exit status of the command. For more information see http://www.lua.org/manual/5.2/manual.html#pdf-file:close

You can also get the exit status using Lua 5.1 but it's definitely nasty (io.popen('your-command; echo $?') and the last line of output is the exit status).

Re: Zsh is your friend.

#67
post #14

Earlier quoted context omitted.

I think your complaining more about shell scripting rather than the terminal use itself.

I think you're underestimating how frequently some folks do things like: for x in 'seq 1 100'; do echo "something with $x"; done (Please forgive lack of backticks on my cellphone keyboard) Or many variations, like every line in a file, or result of a command piped to sed or awk and then processed. Init scripts are about the only shell scripts I write anymore, but I use frequently use it from the commandline, typicall…

[deleted]

Re: Zsh is your friend.

#68

While from what I have read about it zsh is a nice shell, it doesn't deal with what I find to be the biggest problem with bash, sh, and just about every shell that isn't fish: the horribly ugly and inconsistent syntax. And I think it's rather sad that on what is supposedly the most advanced shell of our generation, you still have to deal with a thousand ridiculous redirections and quoting styles, different delimiter…

I have been using fish for several years now. It's community is a fraction of zsh, bash, and others, and I've tried to go back to them, mostly out of misplaced "everyone else is doing it" mindset Fish is a great shell. It's a modern shell, that uses colors, UTF, and processing power that didn't exist when the others were designed. I feel the best thing about it is the sane defaults and large number of prebuilt comple…

This might be one reason fish isn't more widely used. To quote from the documentation[1]:

    Configurability is the root of all evil
[1] http://fishshell.com/user_doc/design.html#conf

As long as the people designing fish believe that, it will be unsuitable for people who want or need customized solutions. That describes a lot of people using shells now.

Re: Zsh is your friend.

#69

While from what I have read about it zsh is a nice shell, it doesn't deal with what I find to be the biggest problem with bash, sh, and just about every shell that isn't fish: the horribly ugly and inconsistent syntax. And I think it's rather sad that on what is supposedly the most advanced shell of our generation, you still have to deal with a thousand ridiculous redirections and quoting styles, different delimiter…

the problem is there are really two things that most shells are trying to simultaneously optimize for--interactive and scripted use. sometimes these conflict in annoying ways--i think the main reason arrays are so obnoxious to use in bash is that their syntax collides badly with glob syntax.

some shells that make excellent script languages are terrible for interactive use--a stock ksh, even ksh93, is pure torture for someone who grew up on bash and zsh and expects completion, history, a nice prompt, decent command editing, etc.

(i'm not sure if the reverse is precisely true, though certainly there are interesting programming features in ksh that are absent in zsh--discipline functions and so on.)

Re: Zsh is your friend.

#70
post #48

Earlier quoted context omitted.

Zsh has knobs for shared history. You can configure all terminals to have the same history at the same time, but I have it set to add history to the .zsh_history file immediately, but each shell gets it's own history. So ctrl-r in a shell lists commands entered into that shell (or preexisting when it started), and opening a new terminal starts with the shared history from all terminals. This is really the best of bot…

im pretty sure bash does shared history if you desire it, the configuration is just not as directly obvious. I prefer a long histfile (unlimited really, i. think i have it set to a million lines, but im at about 70 000. i even keep it backed up regularly because its fairly easy to trash the histfile if you are opening subshells and do the wrongthing. timestamped, too, which i find really handy. that said, i do use an…

Sorry for being off-topic, but do you know how the ZSH history file gets trashed? It's happened so often to me that I wrote a script to reconstruct my history file by combining the last handful of backups. I still haven't figured out how the history file gets trashed though :-(

Edit: Since I'm in ZSH company, here's the script: https://gist.github.com/1713414

Post reply on HN