Shell or Perl for system administration - Unix

This is a discussion on Shell or Perl for system administration - Unix ; I picked up Classic Shell Scripting (O'reilly 2005) and Learning Perl Third Edition (O'reilly 2001) but 'am unsure which to start with. I ordered a new computer with FreeBSD preinstalled (which hopefully will arrive soon) and want to learn UNIX ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: Shell or Perl for system administration

  1. Shell or Perl for system administration

    I picked up Classic Shell Scripting (O'reilly 2005) and Learning Perl
    Third Edition (O'reilly 2001) but 'am unsure which to start with. I
    ordered a new computer with FreeBSD preinstalled (which hopefully will
    arrive soon) and want to learn UNIX system administration. Programming
    is obviously neccesary to automate tasks and customize the system to my
    needs, though I am unsure which language to start with.

    The only experience I have with UNIX based operating systems is using my
    shell account at school. Meaning beyond mail, basic shell commands
    (pipes, editing config files, changing file permissions) I know nothing
    about UNIX or programming.



    --
    Johnny

  2. Re: Shell or Perl for system administration

    Johnny Rotten wrote:
    > Programming
    > is obviously neccesary to automate tasks and customize the system to my
    > needs, though I am unsure which language to start with.


    Start with shell, IMO: you'll want to learn both, but shell is a
    little smaller and simpler, and will suffice for the majority of
    administration tasks. (BTW, unless you really do have an account at
    rotten.com, it's rude to pretend you do. If you want to use a false
    email address, there are ways to do so without using someone else's real
    domain.)

    --
    Oh to have a lodge in some vast wilderness. Where rumors of oppression
    and deceit, of unsuccessful and successful wars may never reach me
    anymore.
    -- William Cowper

  3. Re: Shell or Perl for system administration

    On 2005-08-26, Johnny Rotten wrote:
    > I picked up Classic Shell Scripting (O'reilly 2005) and Learning Perl
    > Third Edition (O'reilly 2001) but 'am unsure which to start with. I
    > ordered a new computer with FreeBSD preinstalled (which hopefully will
    > arrive soon) and want to learn UNIX system administration. Programming
    > is obviously neccesary to automate tasks and customize the system to my
    > needs, though I am unsure which language to start with.
    >
    > The only experience I have with UNIX based operating systems is using my
    > shell account at school. Meaning beyond mail, basic shell commands
    > (pipes, editing config files, changing file permissions) I know nothing
    > about UNIX or programming.


    You will need to know some shell scripting whether you learn Perl
    or not. (You already have some experience with it.)

    You may or may not need to learn Perl for general-purpose
    programming. I don't. If a shell script cannot do it (and there's
    very little it cannot), I use C.

    Knowledge of awk and sed is part of shell scripting, and those
    languages are essential for dealing with large files.

    --
    Chris F.A. Johnson
    ================================================== ================
    Shell Scripting Recipes: A Problem-Solution Approach, 2005, Apress


  4. Re: Shell or Perl for system administration

    Chris F.A. Johnson wrote:
    > On 2005-08-26, Johnny Rotten wrote:
    >
    >>I picked up Classic Shell Scripting (O'reilly 2005) and Learning Perl
    >>Third Edition (O'reilly 2001) but 'am unsure which to start with. I
    >>ordered a new computer with FreeBSD preinstalled (which hopefully will
    >>arrive soon) and want to learn UNIX system administration. Programming
    >>is obviously neccesary to automate tasks and customize the system to my
    >>needs, though I am unsure which language to start with.
    >>
    >>The only experience I have with UNIX based operating systems is using my
    >>shell account at school. Meaning beyond mail, basic shell commands
    >>(pipes, editing config files, changing file permissions) I know nothing
    >>about UNIX or programming.

    >
    >
    > You will need to know some shell scripting whether you learn Perl
    > or not. (You already have some experience with it.)
    >
    > You may or may not need to learn Perl for general-purpose
    > programming. I don't. If a shell script cannot do it (and there's
    > very little it cannot), I use C.
    >
    > Knowledge of awk and sed is part of shell scripting, and those
    > languages are essential for dealing with large files.
    >


    Good advice, thank you. After reading through the first three chapters
    of Classic Shell Scripting and trying out the commands and script
    examples I've already learned allot (maybe that just shows how
    inexperienced I am). The book seems comprehensive but also accessible to
    the beginner, what about Shell Scripting Recipes? Same thing?

    Shell Scripting Recipes and Classic Shell Scripting seem to be very
    similar, both follow the POSIX standard, and cover the same shell
    languages. I'll have to pick up a copy of your book once I get through
    this one.

    --
    Johnny


  5. Re: Shell or Perl for system administration

    Jeremiah DeWitt Weiner wrote:
    > Johnny Rotten wrote:
    >
    >>Programming
    >>is obviously neccesary to automate tasks and customize the system to my
    >>needs, though I am unsure which language to start with.

    >
    >
    > Start with shell, IMO: you'll want to learn both, but shell is a
    > little smaller and simpler, and will suffice for the majority of
    > administration tasks. (BTW, unless you really do have an account at
    > rotten.com, it's rude to pretend you do. If you want to use a false
    > email address, there are ways to do so without using someone else's real
    > domain.)
    >


    Point taken - O' enforcer of netiquette.

    --
    Johnny

  6. Re: Shell or Perl for system administration

    On 2005-08-26, Johnny Rotten wrote:
    > Chris F.A. Johnson wrote:
    >> On 2005-08-26, Johnny Rotten wrote:
    >>
    >>>I picked up Classic Shell Scripting (O'reilly 2005) and Learning Perl
    >>>Third Edition (O'reilly 2001) but 'am unsure which to start with. I
    >>>ordered a new computer with FreeBSD preinstalled (which hopefully will
    >>>arrive soon) and want to learn UNIX system administration. Programming
    >>>is obviously neccesary to automate tasks and customize the system to my
    >>>needs, though I am unsure which language to start with.
    >>>
    >>>The only experience I have with UNIX based operating systems is using my
    >>>shell account at school. Meaning beyond mail, basic shell commands
    >>>(pipes, editing config files, changing file permissions) I know nothing
    >>>about UNIX or programming.

    >>
    >>
    >> You will need to know some shell scripting whether you learn Perl
    >> or not. (You already have some experience with it.)
    >>
    >> You may or may not need to learn Perl for general-purpose
    >> programming. I don't. If a shell script cannot do it (and there's
    >> very little it cannot), I use C.
    >>
    >> Knowledge of awk and sed is part of shell scripting, and those
    >> languages are essential for dealing with large files.

    >
    > Good advice, thank you. After reading through the first three chapters
    > of Classic Shell Scripting and trying out the commands and script
    > examples I've already learned allot (maybe that just shows how
    > inexperienced I am). The book seems comprehensive but also accessible to
    > the beginner, what about Shell Scripting Recipes? Same thing?


    I haven't read "Classic Shell Scripting", but I've heard good
    things about it.

    My book is designed for people of all levels. People at different
    levels will get different things from the book.

    For someone who is not interested in learning shell scripting, the
    scripts can simply be installed and used. They can be downloaded,
    and the included installer will check for shell availability and
    install them with the correct shebang line. These scripts are
    commented, but full documentation in is the book

    For the beginning scripter, the first chapter briefly outlines the
    shell techniques used in the book, and the scripts are commented
    to explain what is going on. The book is not a tutorial, so the
    explanations are not as detailed as they could have been (and they
    would have been repetitive, which was the reason for adding the
    first chapter after the book was one-third written).

    The intermediate or advanced shell programmer can learn from the
    many examples of little-known techniques, and new ways of using
    old tricks. The scripts can be modified to accomplish other tasks.

    There are some things which are not covered in the book, mostly
    because I never (or lamost never) use them.

    # Here documents are not used at all (I think I've only used a
    here document once, because a command wouldn't take input from a
    pipe)

    # 'typeset' and its bash cousin, 'declare', are not part of the
    POSIX specification and are not used in this book; 'local' may
    be used in bash-only scripts

    # 'trap' is used very sparingly

    # 'select' is never used; I find it clumsy to use, and writing a
    simple menu with vastly more flexibility is a trivial task

    # Tracking mouse events is not covered

    # Use of cursor and function keys is not addressed


    > Shell Scripting Recipes and Classic Shell Scripting seem to be very
    > similar, both follow the POSIX standard, and cover the same shell
    > languages. I'll have to pick up a copy of your book once I get through
    > this one.


    --
    Chris F.A. Johnson
    ================================================== ================
    Shell Scripting Recipes: A Problem-Solution Approach, 2005, Apress


+ Reply to Thread