Giter Club home page Giter Club logo

basicshell's People

Contributors

jackbruce0 avatar

Watchers

 avatar

basicshell's Issues

'>>' - Append Output to file

The command should require an already existing file and just append the processes output to specified file.
FAILS IF FILE DOES NOT EXIST

'#' - Enable comment character

ONLY ENABLED FOR SHELL SCRIPTS
ignores rest of line when '#' is encountered
when '#' is attached to word just treat as normal character.

Jake gave me the tip that it is easier to do this if '#' is not a 'metacharacter'

Implement pipe

Basic vertical pipe (done)
Make pipe work with file redirection (done)
New bugs will be reported as separate issues.

!$

when !$ is entered, the last word of the previous statement shall replace it

Bad command handling

p2 ~cs570/Data4/input21

What was sent to stdout was:
%1% %2%
Your shell did not seem to process all subsequent valid commands (echo, cd, pwd).
ERROR ERROR ERROR ERROR
(Note that the last 'cd' DID have a legal number of arguments).

###################

error messages

################### What was sent to stderr was:
Too many arguments

If your stderr message complained about confusing options, then CONGRATULATIONS
may be in order.

Of course, a human will have to judge the quality of your error/warning messages

NOTE: if lots of output lines are being duplicated, this may mean that some
child has not died properly, and has become 'a second p2 parent'.

cd with in history

At the moment changing directories is not supported in history

fixed:
adding history feature actually broke cd b/c I forgot
the cd block was skipping the initialization of the next line of history.
quick fix by add these initializing statements to the cd block

Seg fault when calling prev command

When last command has less arguments then a previous command. Calling that previous command yields a set fault

ex)
%1% echo 1
1
%2% ls
GradeEarly getword.h gradernotes p2 p2.h tags
getword.c getword.o makefile p2.c p2.o
%3% !1
Segmentation fault

This issue occurred because the index after ls in newargv == NULL. passing NULL to strcpy is a no no
I used strdup to solve it. (this uses malloc so may be illegal)

History rules

Test 26... does the history mechanism obey all the funny rules?
Here is the result of ~cssc0013/Two/p2 ~cs570/Data4/input97 :

The contents you sent to stdout was:
%1% last word is uname
%2% last word is uname
%3% %4%
The 'echo' command output should have appeared three times.
The 'echo' command did NOT execute 3 times. ERROR ERROR ERROR ERROR

The fourth command should have added the output of the arch command into a file
called 'arch'.
ERROR ERROR ERROR ERROR

Repeating the 4th command should have doubled the size of arch to 14 characters
ERROR ERROR ERROR ERROR
And finally, the last command should have run 'uname -v'
ERROR ERROR ERROR ERROR
All the input97 commands are legal, so there should be NO error messages.
The data you sent to stderr was:
!$: file does not exist.
ERROR ERROR ERROR ERROR

Three (six) more points were possible here; your total is now 39/42
Scoring 3 points is considered perfect, but if you got everything right,
you could actually score SIX points here!

\| - commented pipe

As of right now, getword does not know the difference between '\|' or '|'
ex) echo hi \| cat -> "hi | cat"

probably involves using a global flag in getword.

splint

splint takes a shit everywhere in this project. will probably do this last

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.