ls
pwd
whoami
datecat < input.txtecho "Hello, MiniShell!" > output.txt
cat output.txtgrep "pattern" < input.txt > output.txtRun commands connected by pipelines to ensure proper execution:
ls -l | grep ".c" | wc -l
cat input.txt | sort | uniqRun commands in the background and manage them:
sleep 10 &jobsfg <job_id>Run a command, then press Ctrl+Z to stop it. Verify with:
jobsbg <job_id>Run a long-running command, e.g.,
sleep 30Press Ctrl+C to terminate it.
Run a command, e.g.,
sleep 30Press Ctrl+Z to stop and move it to the background.
Press Enter without typing anything.
nonexistent_commandls |cd /
pwd
cd ..
pwdexitjobsTest invalid redirections to ensure error handling:
cat < nonexistent_file
echo "Test" > /#!/bin/bash
echo "Testing MiniShell"
echo "1. Basic Commands"
ls
pwd
echo "2. Input Redirection"
echo "Hello World" > test_input.txt
cat < test_input.txt
echo "3. Output Redirection"
echo "Test Output" > test_output.txt
cat test_output.txt
echo "4. Pipelines"
ls | grep ".c" | wc -l
echo "5. Background Processes"
sleep 5 &
echo "6. Job Control"
sleep 30 &
jobs./test_script.sh