• Stars
    star
    1,320
  • Rank 35,625 (Top 0.8 %)
  • Language
    C
  • License
    The Unlicense
  • Created almost 10 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Simple shell implementation. Tutorial here ->

LSH

LSH is a simple implementation of a shell in C, and it is the subject of a tutorial on my website. It demonstrates the basics of how a shell works. That is: read, parse, fork, exec, and wait. Since its purpose is demonstration (not feature completeness or even fitness for casual use), it has many limitations, including:

  • Commands must be on a single line.
  • Arguments must be separated by whitespace.
  • No quoting arguments or escaping whitespace.
  • No piping or redirection.
  • Only builtins are: cd, help, exit.

Running

Use gcc -o lsh src/main.c to compile, and then ./lsh to run. If you would like to use the standard-library based implementation of lsh_read_line(), then you can do: gcc -DLSH_USE_STD_GETLINE -o lsh src/main.c.

Contributing

Since this is the subject of a tutorial, I'm not looking to extend it with additional features at this time. So I won't be accepting any pull requests that aren't related to bug fixes (and I'm sure there are still bugs in the code!).

However, that doesn't mean that you shouldn't play with the code, make changes, and explore new features! That's the whole point of this project! It's just that other people are doing the same thing, and this project is merely a starting point for your own exploration.

On that note, I would be just tickled if you dropped me a line (see my website for contact info) to show me the cool new features you've added!

License

This code is in the public domain (see UNLICENSE for more details). This means you can use, modify, and distribute it without any restriction. I appreciate, but don't require, acknowledgement in derivative works.

More Repositories

1

tetris

Tetris in C and NCURSES.
C
204
star
2

sos

Home-made almost operating system
C
100
star
3

alien-console

A ncurses based clone of the Alien: Isolation console interfaces.
C
55
star
4

tswift

MetroLyrics API for Python
Python
51
star
5

pywall

Python firewall.
Python
36
star
6

userspace_cooperative_multitasking

A simple example of cooperative multitasking in C in userspace
C
33
star
7

alien-iso

An Alien themed Linux "greeting card" ISO image
Shell
24
star
8

cbot

IRC chatbot written in C.
C
24
star
9

libstephen

My own C library. Probably don't use it.
C
24
star
10

minesweeper

Minesweeper in C!
C
21
star
11

kchat

Kernel based chat system.
C
18
star
12

yams

YAMS: Awesome MIPS Server
Assembly
18
star
13

nosj

Simple JSON parsing in C.
C
11
star
14

funlisp

Simple, embeddable lisp interpreter
C
11
star
15

last-makefile

The last makefile you'll ever need.
Makefile
11
star
16

hashchain

C hash chain implementation.
C
10
star
17

bart

BART fare reduction
JavaScript
10
star
18

notes

Org-mode course notes.
CSS
8
star
19

lisp

An old lisp implementation of mine --- see funlisp for a more recent and maintained implementation
C
8
star
20

notifyme

Email notifications for task completion in Python.
Python
7
star
21

pypie15int

Python & Pie 2015 - Create a Twitter Bot!
Python
7
star
22

cky

Not actually anything right now...
C
6
star
23

dotfiles

configuration files and such
Vim Script
5
star
24

plymouth-theme-nostromo

Nostromo Plymouth boot screen
4
star
25

groupme-slackbot

A SlackBot for GroupMe
Python
4
star
26

aproxymate

It's a proxy, mate!
C
4
star
27

brennan.io

Personal/professional website and blog.
SCSS
4
star
28

sudoku

wip sudoku solver that visualizes each step it makes
JavaScript
3
star
29

slacksoc

Slack bot framework. Runs on YAML and procrastination.
Go
3
star
30

gochat

Toy chat protocol in go.
Go
3
star
31

emacs

My old emacs configuration directory (.emacs.d) - I now use Spacemacs!
Emacs Lisp
3
star
32

dpath

EECS 433 Project - Directory Querying using XPath
Go
3
star
33

pybingo

Oldham Bingo 2.0
JavaScript
2
star
34

homework

LaTeX class for homework assignments.
TeX
2
star
35

pathmand

User space MPTCP path manager prototype
C
2
star
36

slackview

Slack log viewing and metrics
Python
2
star
37

evolve

A ridiculously simple evolutionary algorithm in C.
Makefile
2
star
38

sitebuilder

Build my website
Python
2
star
39

compiler

c compiler?
Yacc
2
star
40

smbio

Badly named library containing reusable bioinformatics code.
Python
2
star
41

stevix

what a terrible name
C
2
star
42

vmtools

Tools for making my life happier in my kernel hacking vm
Python
2
star
43

talks

Jekyll site that tags onto my main site and hosts reveal.js presentations, written in Markdown. Simple, really!
Python
1
star
44

h99

Ninety Nine Haskell Problems
Haskell
1
star
45

proxy

A proxy in Java (again)
Java
1
star
46

eecs477

EECS 477: Advanced Algorithms homework.
TeX
1
star
47

thesis

Master's Thesis
XProc
1
star
48

eecs440

EECS 440: Machine Learning Homework
TeX
1
star
49

resume

My LaTeX resume.
TeX
1
star
50

superfreq

Automatic frequency analysis tools for simple ciphers
Python
1
star
51

whiskeybot

let me know when i can buy new whiskey
Python
1
star
52

troubleshoot

Linux troubleshooting wizard!
Python
1
star
53

markov

Markov chain implementation in Python.
Python
1
star
54

caseid

Python interface to useful Case ID utilities.
Python
1
star
55

social

Social Network Expander
Python
1
star
56

hello-world

I wonder how to use github?
1
star
57

person_simulator

Python person simulator API/program/game.
Python
1
star
58

c-from-java

Code examples to go with my OpenHacks session, "C from Java".
Makefile
1
star