Commit 54926411 authored by desiredeveloper's avatar desiredeveloper

adding makefile and readme

parent df8b1910
# Sample Makefile (don't change the filename)
# Modify the below contents as needed
# CFLAGS?= <add flags required for GCC here>
# Considering 2 files in this sample
# file2.c has main(), and will create the executable that you want to run
# file1.c doesn't have main(), but file2.c uses file1.c, and so, file1.c
# needs to be compiled (hence -c flag added separately)
#Modify as per your need
all: rule1 #rule2
rule1: myshell.c myshell.h # file1.c includes header1.h, which is in same dir
$(CC) $(CFLAGS) myshell.c -o myshell
# file2.c also includes header2.h
# rule2: file1.c file2.c header1.h # basically this tells that if any of these files are changed, next cmd should run
# $(CC) $(CFLAGS) myshell.c -o myshell
run: rule1
./myshell demo
clean:
$(RM) rule1
$(RM) -r *.dSYM
$(RM) myshell
# To compile, type this: make
# Then, execute by typing ./file2_executable <in_file>
# To compile and run: make run (this will also execute your program)
# Type: make clean to remove executable & other junk files
\ No newline at end of file
echo hi
echo hi >> file
echo hi >> out
pwd
echo hi >> file
echo hi >> out
pwd
wc -l < out
env
dir .
\ No newline at end of file
......@@ -16,7 +16,7 @@ int fileExists(char *path){
return access( path, F_OK ) != -1 ? 1:0;
}
int folderExists(const char *path)
int folderExists(char *path)
{
struct stat stats;
stat(path, &stats);
......
# Myshell
Myshell is a LINUX shell made to gain implementation level clarity of OS.
## Compilation
```bash
gcc -o myshell.c myshell
```
## Usage
```bash
make run # executes myshell with inputfile
./myshell.c <inputfile> # batch mode
./myshell # interactive mode
```
## Features
* Background Process (&), Serial execution (&&), Parallel Execution (&&&)
* IO redirection (>>,>,<) with &,&&,&&&
* cd with corresponding changes in environment variables (PWD and OLDPWD)
* dir, timed command execution
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to add.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment