Skip to content

Comment on Ask HN: How did you learn Perl/Shell Scripting?

Comments

I learned shell scripting mostly from... actually using the shell as the mothership of mostly any activity I undertake on my machines, be it at work or at home.

The experience you gain by trying not to repeat yourself carries over into scripting, especially if you already know regular imperative programming constructs: you can then just look up how a specific construct is implemented in your shell of choice.

I daily (or maybe hourly) use flow control constructs inline in shell commands, making heavy use of I/O redirection, exit statuses, etc. I've been doing this for over ten years now and I'm still progressing, finding more efficient ways of doing things (currently trying to make a habit of using ZSH's advanced globbing capabilities).

If you run a barebones keyboard-oriented desktop environment / window manager (I use wmii) it becomes very attractive to not have to take your fingers off the keyboard; each little efficiency increment is its own reward. But it's the slow path.

But you asked for links, books and blogs, not my personal experience ;-)

This blog is has some OK articles on Perl/Shell:

http://www.catonmat.net/blog/

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.