

Shell Programming for Beginners - ahmicro
http://ontwik.com/linux/shell-programming-for-beginners/

======
billswift
When you link to a video, show it in the title. I am on a slow connection and
am getting tired of waiting for a page to load, only to find out it is just a
video and totally useless to me.

~~~
ColinWright
Indeed, from the guidelines:

    
    
        If you submit a link to a video or pdf,
        please warn us by appending [video] or
        [pdf] to the title.
    

<http://ycombinator.com/newsguidelines.html>

------
sixtofour
This is great background for newbies.

My kid is learning programming on a VM where he's admin. I went through the
first example and discovered that I don't have banner on my machine. I apt-got
it and realized this will be a nice learning opportunity for the kid, a tiny
real-world hiccup and here's how you solve it and get on with the task.

~~~
kylemaxwell
That alone sounds like a fascinating topic. How old is your kid? Did he ask to
learn, or did you suggest it? What sorts of things is he doing? Etc.

~~~
sixtofour
My kid is 13.

He didn't ask to learn, I suggested it as a possible activity. I stressed that
he doesn't have to want to. We'll know whether he's trying to please his old
man or not after awhile. So far he's liked the new and foreign concepts.

We did a little bit last summer. Based on that experience I'm changing it up a
little, in part by teaching a little more about surrounding concepts like the
shell, and what processes are. This video came around at exactly the right
time.

I showed him how to set up VirtualBox, create and destroy a VM, take snapshots
and why you'd want to, how to install Linux on the box, and the basics of
navigating the shell and running programs.

He's learning Python, with Vim and the Python REPL. Last summer I started him
on Python 3.0, but this year I've had misgivings about that and he's doing
2.7, because if he does remain interested then any framework or other tool
he's likely to use next will be pre-3.0-based.

He's admin on his own VM, because I want him to learn "Dad, how do I do this?"
and then do it for himself, rather than "Dad, it says it needs your password
again."

Last year we focused on Invent Your Own Computer Games With Python,
<http://inventwithpython.com/>. It's a fine tutorial, and he/we got through as
far as the hangman game. This summer I want to take a more broad perspective,
so we'll probably work a little more holistically, sometimes focusing on the
little things we're doing to get something working. Like, what _is_ this
_shell_ that we're using to run things. Whatever book or similar resource we
settle in with, I think we'll just dip into it occasionally, rather than it
being the focus/curriculum.

Last year, as this, he used Vim, and had no trouble with it at all. I had him
go through the first few parts of the Vim tutorial ($
/usr/local/bin/vimtutor), at first sitting next to him until I saw that he
understood enough to progress on his own. Just enough to do basic editing. In
sessions where we sat together I would notice when he repeated a task
inefficiently, and if I saw it enough I would sieze the teachable moment and
show him a better way, then get on with whatever we were focusing on. When he
has a bit more Vim experience we'll probably have one or two Vim-focused
sessions. Same for the shell, and administering his VM.

While the focus is on programming in general and Python more specifically, I'm
trying to gradually make him aware of the wider sea that he's swimming in: how
to read the python docs, how to learn something about the shell, man pages,
focused google searches, what a process is and how to hunt them down and kill
them, etc.

It has been surprisingly challenging to teach the idea of variables, types,
loops, functions and other basic programming concepts that I take for granted.
He's had more algebra in school this past year, and has another year of life
behind him, and I think that's made a big difference in his perspective.

Most importantly it's something for us to do together. I think teaching your
kid something significant is good for you and your kid. Programming is a
useful skill, even if you don't end up being a programmer. But it could just
as well be car repair or sewing, it's the experience itself that's the most
important.

~~~
kylemaxwell
Post of the day, maybe the week.

I have a seven year old daughter with a strong interest in hacking. Her old
man just isn't quite sure how to get her going, but this summer we will try
something or other.

~~~
sixtofour
You might have a look at Scratch, a visual programming environment for kids.
You plug variables and programming constructs together.

<http://scratch.mit.edu/>

Here's my Towers of Hanoi from a few years ago. It runs on Windows Firefox,
but I can't get it to run on Linux Firefox or Chrome; Scratch and Linux's Java
plugin must have parted ways in the intervening years.

<http://scratch.mit.edu/projects/nfnaaron/93232>

~~~
sixtofour
Update: I uninstalled iced tea, installed sun jdk 6, scratch now works fine
with the new java plugin.

------
kaichanvong
First test errored: line 4: test: too many arguments

This was on OSX + bash... wondering if I need to update something to allow
more args through?

#!/bin/sh X=9 tput clear while test $X -gt 0 do tput cup 5 0 tput ed banner "
$X" X='expr $X - 1' sleep 1 done

