any tutorials on simple scripting?

i'm not looking for anything that deals with "if-then" scripts.

i'd like something simple on how to run a series of processes. for example the following:

  1. ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-current/tar_files/
  2. lcd /
  3. get pkgsrc.tar.gz
  4. bye
  5. cd /usr
  6. rm -rf pkgsrc
  7. cd /
  8. tar -xzvpf pkgsrc.tar.gz -C /usr
  9. cd /usr/pkgsrc/pkgtools/pkg_install
  10. make install

i know how to make these cron jobs... but i don't know how to put them in a script so that they'll all happen at one time.

Well, since ftp is an automated process, you could use basic shell scripting, but I personally think one of the safest ways (error handling, etc) wou be to use Expect...

It could be done using here-docs in ksh/bash, though...
For example:

#! /bin/ksh

sitename=ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-current/tar_files/

ftp -in <<-_EOF_
open ftp.netbsd.org
user anonymous email@address.com
cd pub/NetBSD/NetBSD-current/tar_files
[whatever goes here]
bye
_EOF_

cd /where/ever
do_some_stuff

If so inclined you could put some error handling in there, but that will basically do it for you...

You could also use wget or a similar utility to get files from ftp, then process locally...

here's the thing...

what you did... it's totally alien to me. i tried going through the man pages but they don't really help me learn simple things.

i tried a google search, but i didn't find anything particularly userful.

i would like a basic tutorial on how to do small things like i mentioned.

I don't know of a place that is extrondinary for tutorials, but one good site I've used in the past is ShellDorado.

Also, search this site - automated ftps and scripting are brought up all the time...

Let me know if you have any specific questions.