Re: Greetings and salutaions..

From: Johnson David (DavidJohnson_at_Siemens.com)
Date: 02/25/04

  • Next message: R: "My experience"
    To: freebsd-newbies@freebsd.org
    Date: Wed, 25 Feb 2004 12:19:09 -0800
    
    

    On Tuesday 24 February 2004 08:57 pm, Sharif Dayan wrote:

    > I know "command-line", because I once used DOS, but what is
    > "shell-scripting" ?

    This will be a similar answer to others, but explained a bit
    differently...

    Under DOS/Windows you have a command shell. It's called "command.com" in
    DOS. There is a "cmd.exe" shell in NT/XP, but I don't know anything
    about it. The DOS shell is very limited. There is file redirection, but
    not as powerful as in UNIX. There are pipes, but few low level
    utilities can use it. Scripting is limited to (essentially) a
    sequential series of commands in a batch file.

    Under UNIX you have a wide variety of shells. There are two basic
    families of shells, "Bourne" and "C", based on the two earliest shells,
    sh (Bourne) and csh (C). The Bourne shell spawned the Korn shell (ksh)
    and GNU's Bourne Again Shell (bash). csh spawned tcsh, which lacking a
    formal name, I like to call the "Taco Shell". FreeBSD ships with sh and
    tcsh as part of the base system, while bash and ksh are available in
    ports. I would highly recommend using bash as the default shell for all
    user accounts (not root though).

    Since UNIX has very flexible file redirection and pipes, you can
    construct some very poweful commands in the shell. There was no GUI (or
    even two dimensional screen based interfaces) when UNIX was in its
    infancy, so everything had to be done on the command line, and line by
    line. But except for having to memorize many commands and their
    options, this was not a hindrance, because you could (and can) do some
    amazing things on the command line.

    The power is extended to shell scripts. A script is nothing more than a
    file that contains shell commands. But since UNIX shells have some
    programming constructs built in (conditionals, loops, etc), scripts are
    really programs, and not mere batch files. Bourne shells are the best
    for writing scripts, and my recommendation is to always use the plain
    vanilla "sh" for scripting.

    How powerful are shell scripts? Consider that once the FreeBSD kernel
    has finished loading and initializing, virtually everything else at
    bootup is done through a shell script. All of the daily, weekly and
    monthly security checks and reports are done with shell scripts.

    Shell scripts are the glue that hold UNIX together. But they're simple
    and versatile enough for even you to learn and use every day.

    Cheers,

    David Johnson
    _______________________________________________
    freebsd-newbies@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-newbies
    To unsubscribe, send any mail to "freebsd-newbies-unsubscribe@freebsd.org"


  • Next message: R: "My experience"

    Relevant Pages

    • Re: Crashed Minix after < 24hrs... is this a record?
      ... fine, it is the shell and shell commands that are having trouble, ... I have some exposure to Unix, ... proper is not my area. ...
      (comp.os.minix)
    • Re: Making a Unix-like environment with an Apple IIe...
      ... there your new SYSTEM file resides to keep it from getting ... commands that add disk/file commands to the Applesoft language in ROM ... I was thinking of having the shell behave like this...The shell takes ... think you are confusing the UI presented by a UNIX shell with the UNIX ...
      (comp.sys.apple2.programmer)
    • Re: how to make function known to subshell
      ... What do I have to do to make a function available in shell scripts or ... When a command is parsed the first word will be checked against the ... In the Korn Shell, there are two separate syntaxes for defining ...
      (comp.unix.shell)
    • Re: ruby shell?
      ... If it had not all ready been largely done in C, Perl, Lisp, and KornShell ... versions I'd probably work on a shell and posix oriented userland for fun. ... The scripts i write are _bourne_ shell scripts, ... Unix utilities have been rewritten as Korn Shell scripts and it even can be ...
      (comp.lang.ruby)
    • Re: Quick help
      ... in directories in the unix v6 shell. ... Which also doesn't cause "erratic behavior" - it's just a security ... commands in their directory. ...
      (comp.unix.questions)