Our Linux shell supports all Linux commands and a few extra commands.
use the following command to install readline library before running the shell:
sudo apt-get install libreadline-dev
gcc shell.c -lreadline
./a.out
-
fs → prints the first string of each line of input file
-
mw → prints the most frequent word in file
-
rs → removes empty spaces from file
-
rmc → prints uncommented lines of file
-
lc → prints the number of file lines
-
ft → prints first ten lines of file
All additional commands are used this way:
[command] [file path]
For example if test file be as follows:
Good morning
hi ali
hello world
The result will be:
fs /Desktop/test.txt
Good
hi
hello
-
Save commands in history
-
User can switch between commands that saved in history and choose one of them
-
Support pipeline commands
-
Fork new process for every command
-
Print errors using stderr
-
Customize control-c action