background preloader

*UNIX

Facebook Twitter

Starting Off With a Sha-Bang. In the simplest case, a script is nothing more than a list of system commands stored in a file.

Starting Off With a Sha-Bang

At the very least, this saves the effort of retyping that particular sequence of commands each time it is invoked. Example 2-1. cleanup: A script to clean up log files in /var/log There is nothing unusual here, only a set of commands that could just as easily have been invoked one by one from the command-line on the console or in a terminal window. The advantages of placing the commands in a script go far beyond not having to retype them time and again. The script becomes a program -- a tool -- and it can easily be modified or customized for a particular application.

Example 2-2. cleanup: An improved clean-up script Now that's beginning to look like a real script. Example 2-3. cleanup: An enhanced and generalized version of above scripts. Since you may not wish to wipe out the entire system log, this version of the script keeps the last section of the message log intact. The sha-bang ( #!)

Linux

Books for Learning Unix. The goal of this page is to help programmers who want to become fluent Unix users.

Books for Learning Unix

Although my Unix of choice is Linux, open systems don't buy you much if you're locked into one particular platform; you benefit the most from competition if you and your programs are comfortable with any mainline implementation of Unix (namely, Linux, Solaris, BSD, and MacOS/X). The books recommended below tend to reflect this opinion.

Be sure to read the reviews before buying. Books on Using Unix These can help you get started with interactive use of the shell and tools like grep and vi. Books on System Administration There's a fine line between a fluent Unix user and a Unix system administrator. Books on Shell Programming / Shell Scripting One huge part of learning how to use Unix is learning how to write shell scripts. In my opinion, one should stick to the least common denominator when writing shell scripts: portable Bourne shell syntax. The books recommended below tend to reflect the above opinion. Free Online Unix Training Materials. The goal of this page is to help programmers who want to become fluent Unix users, programmers, and system administrators.

Free Online Unix Training Materials

(Given Unix's emphasis on empowering users, sometimes it's hard to tell where the boundaries are between those three categories!) Unix Commandline Skills Manuals and Course Notes, listed in order of increasing skill level Oregon State University's "Coping with Unix: An Interactive Survival Kit" For beginners. Louis Taber's Online Class Notes; intros to Unix and to C; 2001. Free. Unix Programming Skills Little Unix Programmers Group How to program in the Unix environment. The vi text editor The vi editor was introduced in 1983 or so, and its antiquated user interface makes it painful to learn.

C / C++ / Assembly Programming Tutorials See also my list of online C/C++/Assembly tutorials. Other Online Unix Training Compendium Sites CRISP: Community Resource and Instructor Support Program -- "The site for Unix instructors and aficionados to share ideas. "