Live data from Hacker News

A Bourne-style shell built from scratch in 35 minutes [video]

destroyallsoftware.com

31–40 of 71 posts

Re: A Bourne-style shell built from scratch in 35 minutes [video]

#31
post #13
post #5

Earlier quoted context omitted.

There are no such things as “ the ” escape codes. Any terminal could have any codes. You would have to look at the TERM environment variable and use codes appropriate for that terminal. There are, of course, libraries to do this for you, such as terminfo and ncurses. But never output raw escape codes yourself - all the world is not a VT100 or Linux terminal.

I think the original poster does not want to output escape codes, he wants to build a terminal that will accept escape codes like a xterm. This way, he won't need to create a new terminal type with all the terminfo or ncurses configuration.

The two other terminal multiplexers I know of are GNU screen and tmux. GNU screen defines its own “screen” terminal type in terminfo, and tmux shamelessly re-uses it and claims to be “screen-256color” (screen with 256 colors). So I don’t think there is any good way to avoid it.

Re: A Bourne-style shell built from scratch in 35 minutes [video]

#33
post #21

I was so disappointed that they chose Ruby. I would have been impressed if they had chosen bare C and still manage to build it under 35 minutes.

For my system programming class we had to write a Unix shell in C. I procrastinated and wrote the whole thing in one 38-hour caffeine-fueled sprint on a 32-bit SPARC SunStation. I don't think it supported pipes but it did support input/output redirection and ANDing of commands. Not my best product, but some of my best work.

Re: A Bourne-style shell built from scratch in 35 minutes [video]

#34

On this note, I need to build my own Terminal multiplexer - does anyone have a favorite primer of theirs for all the escape codes? Not only do I need to use them myself, but I need to handle them of child processes to restrict term sizes etc. I can Google like ya'll - I'm just asking if there are any favorite resources :) Thanks

Not strictly answering your question, but years ago I worked on a job which comprised a group of us sitting in a room, each with a VT100 connected to a Unix box in the corner, cranking out C. We weren't massively overworked, so one clever bugger wrote his own terminal multiplexer on the side, enabling him to flip between sessions using function keys. Another guy wrote a shell - in Bourne shell. It had, errm, a few is…

My 2nd year college project (UK college not US very different things) was a VT100 emulator written in Delphi.

In hindsight I should have done what the rest of the class did and took the Blackjack option but there was the option to do our own project instead, I demonstrated it worked by connecting it to my Linux laptop (this was '98, I was a strange 18yo).

I was into LambdaMoo and mtrek at the time and I wanted to understand how they worked better :).

Re: A Bourne-style shell built from scratch in 35 minutes [video]

#35
post #24
post #19

By the way, IMHO much of the ugliness of shells comes from the requirement that simple filenames are to be used without additional escape characters. I think we should ditch that requirement.

My fantasy crosscutting change is outlawing spaces in filenames, at the filesystem level!

my fantasy is they design a shell language where it's impossible to write anything that fails if there are spaces in filenames

Re: A Bourne-style shell built from scratch in 35 minutes [video]

#37

Was expecting more guns, car chases, exotic city backgrounds, and slightly-above-average women from the new Bourne shell. Turns out it's just a command line interpreter. Two stars.

I don't really think there's any call for such an objectification of women. The joke would have been just fine without it.

Re: A Bourne-style shell built from scratch in 35 minutes [video]

#38
post #31
post #13

Earlier quoted context omitted.

I think the original poster does not want to output escape codes, he wants to build a terminal that will accept escape codes like a xterm. This way, he won't need to create a new terminal type with all the terminfo or ncurses configuration.

The two other terminal multiplexers I know of are GNU screen and tmux. GNU screen defines its own “screen” terminal type in terminfo, and tmux shamelessly re-uses it and claims to be “screen-256color” (screen with 256 colors). So I don’t think there is any good way to avoid it.

I just assumed it's what someone who'd actually thought about the problem did for performance.

Re: A Bourne-style shell built from scratch in 35 minutes [video]

#39

Such negative Nellies. This is why I don't publish anymore. You try to teach people something fun, and show people you can do quite a lot with very little. But it's nothing but criticism, and none of it constructive.

It depends on where you look. Hacker News is pathologically tilted toward negative sentiment, usually in the form of look-how-smart-I-am. I also announce these screencasts on Twitter, where the the response is universally positive (in six years, I can't remember a single rudely negative comment about a Destroy All Software screencast). Not that Twitter lacks its own problems, of course!

Re: A Bourne-style shell built from scratch in 35 minutes [video]

#40
FOXX Financial Loan Offer

  We give out loan at the rate of 3% interest rate, if you are interested for a loan, you are here by
advise to fill and return the loan application form to this Email( foxx.loanfinancialaid@gmail.com) alone to know if you are truly interested in loan. I am here to put smiles in all sad faces.

FULL NAMES: ADDRESS: COUNTRY: AMOUNT NEEDED: DURATION OF LOAN: PURPOSE OF LOAN: SEX: MARITAL STATUS: MONTHLY PAYMENT: PHONE NUMBER: EMAIL:

By replying with these details to (foxx.loanfinancialaid@gmail.com), we shall move forward to the next step which is the terms and re-payment plan schedule.

Mr. Howard M Colleman .

Phone: +18475128241

Post reply on HN