Kurinchi Blogger Scribbles …


Posts Tagged ‘shell scripting’

Mar 21
2010

Shell Scripting: Saving Shell scripts

Last updated: March 20th, 2010

For example, if we have shell script named “myshellscript.sh” (with execute permission) we can make it run in the current working directory with the commands

$ sh myshellscript.sh (or)
$ ./myshellscript.sh

If the shell scripts are stored in an executable path, it will save us from typing extra keystrokes. To find the paths that are setup, type

$ echo $PATH
/usr/bin: /usr/local/bin

(more…)

Mar 20
2010

Shell Scripting: How to execute Shell Scripts?

Last updated: March 20th, 2010

Shell scripts are written to execute a set of commands and to group them. The scripts will have the following special line

#!/bin/bash

This is an indication that the shell script is used in bash shell and that it should be called for command execution.

To know the path of the bash shell, type
$ cat /etc/shells
(more…)

Mar 19
2010

Shell Scripting: What is Shell?

Last updated: March 19th, 2010

Shell is an environment around the Kernel providing user interaction. It accepts user commands and convert them to binary code. It is not part of the kernel but uses the kernel to execute the commands.

Commonly available shells
- BASH (Bourne Again Shell)
- CSH (C Shell)
- KSH (Korn Shell)

All these shells do the same job and the differences come in the form of syntax that these shells use to execute commands and the built-in functions that comes along with it.

You can find the shell that is in execution by typing
$ echo $SHELL

To find all the available shells in the system, type
$ cat /etc/shells


Valid HTML 4.01 Strict  Valid HTML 4.01 Strict