News for hackers. Stuff that matters.
Re:Zsh is your friend. by kruhft on Tuesday January 31, 2012 @12:00PM (#3534080)
Once you learn the zen of shell script, like any programming language, those problems pretty much go away. Shell script is a tiny language packed with features and can be learned through constant use in a week, but like any language, it takes time to master.

It's incredibly powerful for interactive use and data manipulation combined with the standard Unix tools and sometimes pulling out perl or python is more work than just banging out a pipeline on the command line.

Quoting does take some time, but just remember that when in double to quote your variable expansions with double quotes. There's more too it, but that's a good rule to start with.

Re:Zsh is your friend. by jlebar on Tuesday January 31, 2012 @12:13PM (#3534140)
Maybe I lack the proper zen, but I haven't found this to be true at all.

Here's a good bash FAQ. It contains questions like "how do I use associative arrays", with answers like "this is a complex question."

I don't even have to ask in any half-decent scripting language.

http://mywiki.wooledge.org/BashFAQ/

Re:Zsh is your friend. by kruhft on Tuesday January 31, 2012 @12:20PM (#3534170)
I reccommend ksh over bash. That's all I use these days. It was sh done right, although it does have a bit of history to it for compatibility.

To use associative arrays in ksh:

  typeset -A table
  column="name"
  table[$column]="value"
  echo ${table[$column]}
ksh is much more decent than bash, although I reccommend using in an emacs M-x shell buffer for better command line editing.

Edit: forgot to dereference column when setting value in table.

Re:Zsh is your friend. by _seininn on Tuesday January 31, 2012 @12:48PM (#3534312)
For reference, to use associative arrays in Bash:

  declare -A table
  column="name"
  table[$column]="value"
Included in recent versions of bash :)
Re:Zsh is your friend. by kruhft on Tuesday January 31, 2012 @01:11PM (#3534408)
I say typeset, you say declare, let's call the whole thing off! :)
Re:Zsh is your friend. by itmag on Wednesday February 01, 2012 @05:16AM (#3537393)
Maybe you should do some lessons on this on any of the e-learning sites? I bet a lot of people would pay $25 or whatever for that.