Coder Social home page Coder Social logo

build-your-own-shell's People

Contributors

katee avatar sebastianselander avatar tokenrove avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

build-your-own-shell's Issues

Broken link to hell

Hey!

The hell link currently 404s because the author cleared out the original repo. Maybe either removing the link or linking to an old commit would be a good fix?

Thanks for putting this together, it's really awesome 🎉

Talk more about parsing

Lexing into words, and the strange interrelationship with parsing, especially once quoting is introduced, is really hard, and we don't talk about it at all here. It will be easier to expand this when I make pedagoguish, frosh, and squish public, each of which uses a different parsing strategy.

Give more helpful output on test failure

Right now you don't get much, but it should probably print out the lines of the test description, or even replay a script of the actual session with the shell, and highlight where things went wrong.

Bash fails on `stage1:05-and-or-chaining.t` due to error message

I tried running the tests with both bash and zsh and they both fail on the same test (05-and-or-chaining.t)

❯ ./validate /usr/bin/bash
stage_1: 01-fork-exec.t 02-commands-invoked-from-path.t 03-cd-changes-directory.t 04-semicolon-separates-commands.t 05-and-or-chaining.t

# POSIX calls these AND Lists and OR Lists
→ true && echo-rot13 foo⏎
← sbb
→ false && echo-rot13 foo⏎
≠ sbb
→ true && false && echo-rot13 foo⏎
≠ sbb
→ false || echo-rot13 foo⏎
← sbb
→ true || false || echo-rot13 foo⏎
≠ sbb
→ false || true && echo-rot13 foo⏎
← sbb
→ nonexistent-command 2>/dev/null || echo-rot13 zim⏎
← mvz

---------------------------
You still need to do stage_1
Keep working!

Seems like they are failing on the last assertion of the test case:

→ nonexistent-command || echo-rot13 zim⏎
← mvz

I ran the tests in interactive mode and I believe the problem is that both bash and zsh are printing an error message for the command not found. Here's an example in a vanilla bash shell:

$ nonexistent-command || ./helpers/echo-rot13 zim
bash: nonexistent-command: command not found...
mvz

Versions

❯ expect -v
expect version 5.45.4
❯ bash --version
GNU bash, version 5.2.15(1)-release (x86_64-redhat-linux-gnu)
❯ zsh --version
zsh 5.9 (x86_64-redhat-linux-gnu)

Implement simple property testing

Ever since I rewrote the tests with silly Unicode characters, I wanted to have placeholders like σ for an arbitrarily quoted string, φ for a random file name, Γ for a globbable set of files and γ for the glob that matches, et cetera, to provide a modicum of property testing. To be effective, this should have shrinking, as well as a way to get the normative definitions of these variables (currently typically foo and such).

Test for shell's successful exit is implicit and confusing (was: Weird issue with tests?)

me@DebianXfce23F:~/projects/lsh-shell/build-your-own-shell$ ./validate ../lsh
stage_1: 01-fork-exec.t 
→ /bin/echo foo bar⏎
↵ foo bar
→ tr a-z n-za-m⏎
→ foo bar baz⏎
↵ sbb one onm
→ ^D
→ ./helpers/echo-rot13 foo bar⏎
↵ sbb one
→ ./helpers/echo-exit ./helpers/successful-exit-status⏎
↵ 0

---------------------------
You still need to do stage_1
Keep working!

Unsure where I am actually going wrong here, I think I poorly understand your "validate".

I've attached my C source code if you'd like to look through any of it to detect where I've gone wrong.
lsh.c.txt

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.