Skip to content

Susana-Ye/ShellScriptInterpreter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🖥️ Scripter: Linux Shell Script Interpreter [C Project]

📝 Description

Scripter is a command interpreter written in C for Linux, designed to emulate core functionalities of a shell as part of an Operating Systems lab. It reads a script file line-by-line, interprets and executes each command using POSIX system calls. The project reinforces understanding of process management, file descriptor manipulation, piping, I/O redirection, and background execution.

The interpreter also supports an external command (mygrep), developed as a C program that mimics grep functionality, searching for strings within files.

🛠️ Languages and Utilities Used

  • C
  • GCC
  • POSIX System Calls
  • Linux

📷 Output Examples

Valid script execution:
Scripter output

Redirection and piping example:
Redirection output

Background command with PID output:
Background PID

Mygrep execution:
Mygrep output

📌 Features

  • Validates script header (## Script de SSOO) and format.
  • Executes sequential Linux commands line-by-line.
  • Handles:
    • Simple commands with arguments.
    • Piped commands.
    • Input (<), output (>), and error (!>) redirections.
    • Background execution (&) with proper PID printing and zombie management.
    • Launches external command mygrep with same redirection/background capabilities.

📽️ Usage Instructions

  1. Clone or Download the Project
  2. Compile using Make:
make all       # builds scripter and the external 'mygrep' command
  1. Execute with a script file:
./scripter example_script.txt    # the first line of script.txt must be '## Script de SSOO'
  1. Clean binaries:
make clean      # cleans the build files

🧑‍💻 Authors

  • Susana Ye Zhan
  • Xinyi Yewu
This project is for educational purposes only. All rights reserved to Universidad Carlos III de Madrid.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published