background preloader

Linux

Facebook Twitter

Linux Tip

Linux Shell Scripting Tutorial - A Beginner's handbook. Shell Programming! A working knowledge of shell scripting is essential to anyone wishing to become reasonably proficient at system administration, even if they do not anticipate ever having to actually write a script. Consider that as a Linux machine boots up, it executes the shell scripts in /etc/rc.d to restore the system configuration and set up services. A detailed understanding of these startup scripts is important for analyzing the behavior of a system, and possibly modifying it. The craft of scripting is not hard to master, since scripts can be built in bite-sized sections and there is only a fairly small set of shell-specific operators and options to learn. The syntax is simple -- even austere -- similar to that of invoking and chaining together utilities at the command line, and there are only a few "rules" governing their use. Most short scripts work right the first time, and debugging even the longer ones is straightforward.

What follows is a tutorial on shell scripting. Learn Linux, 101: The Linux command line. Overview This article gives you a brief introduction to some of the major features of the bash shell, and covers the following topics: Interacting with shells and commands using the command lineUsing valid commands and command sequencesDefining, modifying, referencing, and exporting environment variablesAccessing command history and editing facilitiesInvoking commands in the path and outside the pathUsing man (manual) pages to find out about commands This article helps you prepare for Objective 103.1 in Topic 103 of the Junior Level Administration (LPIC-1) exam 101. The objective has a weight of 4. The material in this article corresponds to the April 2009 objectives for exam 101. You should always refer to the objectives for the definitive requirements.

Back to top The bash shell The bash shell is one of several shells available for Linux. Before we delve deeper into bash, recall that a shell is a program that accepts and executes commands. Shells also use three standard I/O streams: Echo Env. Bash Guide for Beginners. An A-Z Index of the Bash command line for Linux. OpenSSH.