What exactly is shell scripting?
And what is Bash, Korn, and Expect? I use a few commands in a Linux terminal, is that shell scripting too? Again I am confused what exactly is shell scripting?
What exactly is shell scripting?
And what is Bash, Korn, and Expect? I use a few commands in a Linux terminal, is that shell scripting too? Again I am confused what exactly is shell scripting?
Shell scripting is the process of creating a file containing several shell commands (i.e. ls
, cd
, grep
, etc) than can then be executed.
bash and korn are both shells - they allow you to interface with the computer through a command line, rather than running programs by clicking on icons.
The purpose of shell scripting is to automate repetitive tasks, such as setting up an environment to launch a program, or checking to see if logfiles have changed, or archiving a directory (or set of directories) or any other number of tasks.
Check this out for more info.
Your terminal runs a shell , probably bash - korn, csh and others are similar shells with different features and syntax.
While you probably use it mostly to run commands, most shells are an interpreter for command language defined by that shell. Programs in that language is called a shell script. See this howto for an overview of shell scripting in bash.
http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=define:+shell+script
Shell scripting lets you automate tasks that you do from the command line.
In addition to being an interaction environment the shell (be it the original Bourne shell (/bin/sh
) or one of the many alternatives (ksh, csh, bash, zsh, tcsh, ...) with different or extended syntax) provides programming language like features (looping, conditionals, functions, variables...).
Shell scripting is more or less writing a program in you favorite shell.
The line between using the shell and scripting is fuzzy, but I'd put it near "solving a class of problems by writing some shell code that is smart in some way".
A shell script is a script written for the shell, or command line interpreter, of an operating system. It is often considered a simple domain-specific programming language. Typical operations performed by shell scripts include file manipulation, program execution, and printing text.
Many shell script interpreters double as command line interface, such as the various Unix shells, Windows PowerShell or the MS-DOS COMMAND.COM. Others, such as AppleScript or the graphical Windows Script Host (WScript.exe), add scripting capability to computing environments without requiring a command line interface. Other examples of programming languages primarily intended for shell scripting include DCL and JCL.