Thanks to visit codestin.com
Credit goes to github.com

Skip to content
/ shell Public

A Simple Shell v1.5 is a basic shell implementation in C. It supports executing commands and parsing user input in a Unix-like environment.

Notifications You must be signed in to change notification settings

RamezHas/shell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌀 SimpleShell v1.5

An enhanced custom shell with variable support and I/O redirection.

Language Version Status


🧭 About

SimpleShell v1.5 is an enhanced version of our minimal shell interpreter.
Now featuring:
✅ Variable management (set/get commands)
✅ I/O redirection (> and < operators)
✅ Variable expansion in echo commands
Maintains all previous functionality while adding powerful new features.


⚙️ Built-in Commands (Updated)

🔧 Command 📝 Description
help List all available commands
pwd Show current working directory
echo Print arguments (supports $var expansion)
exit Exit the shell
set Set variable (name=value syntax)
get Get variable value

🆕 New Features

🔄 Variable Expansion

Use $var_name in echo commands to display variable values:

$ set name=Alice
$ echo Hello $name!
Hello Alice!

📤📥 I/O Redirection

Redirect output with > and input with <:

$ echo "File content" > output.txt  # Write to file
$ cat < input.txt                  # Read from file

🛠️ Build & ▶️ Run

gcc shell.c -o shell
./shell

💡 Example Usage

$ help
Available commands:
  exit    	Exit the shell
  pwd     	Print current directory
  echo    	Print arguments
  help    	Show this help message
  set     	Set variable (name=value)
  get     	Get variable value

$ set message="Hello World"
$ get message
message=Hello World

$ echo $message > greeting.txt
$ cat < greeting.txt
Hello World

$ echo "Current directory:" && pwd
Current directory: 
/home/user/simpleshell

$ invalid_cmd
Command not found: invalid_cmd

$ exit

About

A Simple Shell v1.5 is a basic shell implementation in C. It supports executing commands and parsing user input in a Unix-like environment.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published