Skip to content

Basic unix shell emulator that operates on a tar archive as a virtual filesystem.

License

Notifications You must be signed in to change notification settings

snz89/UnixShellEmulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UnixShellEmulator

This project provides a basic Unix shell emulator that operates on a tar archive as a virtual filesystem.

Features

  • Emulates basic Unix commands: ls, cd, pwd, exit, history.
  • Operates on a tar archive without unpacking.
  • Customizable username and computer name in the prompt.
  • Logging of commands with timestamps and username.
  • Support for executing a startup script.

Usage

To run the emulator, use the following command:

python emulator.py -u [username] -c [computername] [filesystem.tar] -l [logfile.csv] -s [script.txt]
  • -u, --user: Username (default: user)
  • -c, --computer: Computer name (default: localhost)
  • <filesystem.tar>: Required. Path to the tar archive containing the virtual filesystem.
  • -l, --log: Path to the log file (default: log.csv).
  • -s, --script: Path to a script file to execute on startup.

Example:

python emulator.py -u myuser -c mycomputer myfilesystem.tar -l mylog.csv -s myscript.txt 

Docker Usage

You can easily run the UnixShellEmulator using Docker. This allows for a consistent environment without needing to install dependencies on your local machine.

Prerequisites

Build the Docker Image

Navigate to the project directory where your Dockerfile is located, and build the Docker image with the following command:

docker build -t unixshell-emulator .

Run the Emulator

To run the emulator, you can mount a local directory containing your tar archive and log file. Use the following command:

docker run -it --rm -v /path/to/local/directory:/app/data unixshell-emulator /app/data/filesystem.tar -u [username] -c [computername] -l /app/data/logfile.csv -s /app/data/script.txt

About

Basic unix shell emulator that operates on a tar archive as a virtual filesystem.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published