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