Skip to content

Latest commit

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

🌀 SimpleShell v1.5

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

LanguageVersionStatus


🧭 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
helpList all available commands
pwdShow current working directory
echoPrint arguments (supports $var expansion)
exitExit the shell
setSet variable (name=value syntax)
getGet 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

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages