0% found this document useful (0 votes)
9 views1 page

Shell Programming Notes

Shell is an interface between the user and the operating system, executing commands provided by the user. Shell scripting automates tasks through files containing UNIX/Linux commands, with specific syntax and variable handling. Basic UNIX commands include listing files, changing directories, and managing files.

Uploaded by

rawatanju5055
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views1 page

Shell Programming Notes

Shell is an interface between the user and the operating system, executing commands provided by the user. Shell scripting automates tasks through files containing UNIX/Linux commands, with specific syntax and variable handling. Basic UNIX commands include listing files, changing directories, and managing files.

Uploaded by

rawatanju5055
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Shell Programming Notes

1. What is Shell?
Shell is a program that acts as an interface between the user and the operating system. It takes
commands from the user and executes them.

2. Shell Scripting
A shell script is a file containing a series of UNIX/Linux commands. It is used to automate tasks.

3. Shell Script Basics


- File extension: .sh
- First line: #!/bin/bash
- Run script using: sh [Link]

4. Shell Variables
Variables store data. No space is allowed around '=' sign.
Example: name="Anju"

5. Command Line Arguments


$1, $2 are arguments
$# shows number of arguments
$@ shows all arguments

6. If Statement
Used for decision making.
Syntax:
if [ condition ]
then
commands
fi

7. Loop
Loops are used to repeat tasks.
Types: for loop, while loop

8. Return
Return statement sends status value from function.

9. Basic UNIX Commands


ls – list files
pwd – present directory
cd – change directory
cp – copy files
mv – move files
rm – delete files
cat – display file content
mkdir – create directory

You might also like