Mininal skills

Donald Wilde dwilde1 at
Fri Jun 5 11:27:24 UTC 2020

On 6/4/20, Michael Schuster <michaelsprivate at> wrote:
> On Fri, Jun 5, 2020 at 8:22 AM Brenda J. Butler <bjb at> wrote:
>> As for "what is shell programming" ... it's the same as regular
>> programming
>> but written in a language that doesn't need to be compiled.  Often the
>> shell program calls on other programs to do the work.  So learning "shell
>> programming" is about more than learning the shell language - it is
>> also about learning enough of those other little utilities to be
>> able to do something useful in the shell.
> One of the best books on the subject (in my experience) is "The Unix
> Programming Environment" by Kernighan and Pike - written in 1984, it is
> still a good text to teach you some of the fundamentals of the ... unix
> programming environment ;-).
> I highly recommend it.

I agree! Very good book! Another good one is 'UNIX Network
Programming' by Stevens, and soon enough you'll be ready for 'Advanced
Programming in the UNIX Environment', also by Stevens (Sorry, I'm a
'dead tree' addict!).

One important thing to add in regards to program execution -- covered
in the books but deserves mention so you can get going faster .

While compiled binaries on 'NIX systems like FreeBSD are distributed
in ELF format (which you can look up if you are interested), files
intended for a scripting language such as a shell have a very special
sequence of characters the shell looks for at the beginning: '#!',
also called 'she-bang'.  These MUST be the first two characters in the
text file, followed by the location of the program you want to use to
execute the file, such as '#!/usr/local/bin/ruby27' for the latest
version of Ruby. You can also specify a different shell binary as your
program. For example, I execute a file with '#!/bin/sh' with the
simple Bourne shell 'sh' from my root prompt when root's normal shell
(on FreeBSD) is tcsh. The syntax of each shell's language is somewhat
different, so take care. Just dive in with your text editor, create a
few files, and try to run them. If you haven't already, use 'chmod + x
myfile' to make them run directly from the prompt, like:


the period-slash combo tells your shell that the current directory is
where to find that file; otherwise, it'll merrily look for your
program in /bin, /usr/bin, etc.
Don Wilde
* What is the Internet of Things but a system *
* of systems including humans?                     *

More information about the freebsd-questions mailing list