Welcome to the Introduction to Shell Scripting repository! This project is designed to introduce shell scripting for automating tasks in Unix/Linux environments. It covers a wide range of topics, from basic command-line operations to more advanced shell script development.
Shell scripting is a powerful way to automate tasks, manage systems, and interact with Unix/Linux operating systems. It combines the simplicity of command-line utilities with the flexibility of programming logic, allowing users to automate repetitive tasks, manage system operations, and perform complex operations with minimal manual intervention.
This repository contains examples of shell scripts that demonstrate key concepts such as process management, file handling, task automation, and system monitoring.
This repository includes practical shell scripting examples that demonstrate:
- Basic Shell Commands: Common commands like
ls,pwd,cd,cp,mv, andrm. - Variables and Parameters: Using variables and accepting parameters in shell scripts.
- Control Structures: Conditional statements like
if,else, and loops such asfor,while, anduntil. - File Handling: Working with files and directories, reading and writing data, and checking file statuses.
- Process Management: Handling background and foreground processes, and using
ps,kill, andjobs. - Text Processing: Using
grep,sed,awk, andcutto process text data efficiently. - Task Scheduling: Automating tasks using
cronandat. - System Monitoring: Scripts to monitor CPU, memory, disk usage, and network activity.
- Error Handling: Incorporating error handling and debugging techniques in shell scripts.
Before running the scripts, ensure you have access to a Unix-like operating system (Linux, macOS, etc.) and a shell environment like bash, sh, or zsh. You can check your shell version by running:
echo $SHELL##🗂️ Project Structure
simple_shell/
├── README.md
├── _a_ati.c
├── am_bult_in.c
├── am_bult_in1.c
├── am_envget.c
├── am_envn.c
├── am_errors.c
├── am_errors1.c
├── am_history.c
├── am_infget.c
├── am_lineget.c
├── am_list.c
├── am_list1.c
├── am_loop_sh.c
├── am_memory.c
├── am_parser.c
├── am_storage.c
├── am_strings1.c
├── am_strings2.c
├── am_strings3.c
├── am_tokenizer.c
├── am_vars.c
├── header.h
├── hsh
└── main.c
1 directory, 25 filesto run the program:
./hshor run separated:
python3 run.py