Recent submissions

Comment · 11 years ago
For shells that lack echo -e and printf (yes, there are such shells; at least, I use one):

  echoe(){ local a=${#1}; echo $1 |dd bs=1 count=$a;}
Comment · 11 years ago
Indeed. My apologies. Instructions to get the URL to the Hartl draft are the same, except:

  Substitute "learnenough.com/command-line" for "conqueringthecommandline.com/book"
 
Script will work just the same.
Comment · 11 years ago
Use the command line to get the URLs for each chapter?

  Go to conqueringthecommandline.com/book
  Save the page source
  Insert the filename into the script below
  Alternatively, omit filename and pipe the source of the page to the script 

  Works with BSD sed as well as GNU sed; first lesson: portability

   a=$(printf '\004')
   sed 's/s3_url/'"$a"'&/' \
   |tr '\004' '\012' \
   |exec sed '
   s/\\u0026/\&/g;
   s/.*s3_url.:.//g;
   s/\".*//g;
   /https:.*Amz/!d;
   ' filename
I do not recommend this "book". Look at the hoops they make readers jump through. Try grymoire.com; much better and no Javascript required
Comment · 11 years ago
I guess journalists read HN looking for stories? I was suprised to spitbol mentioned on HN and now there is a story on Vice news?

Alas, the interviewer asked no technical, interesting questions. There is a portable assembly language called MINIMAL that is used in spitbol. This could be a topic for an entire story itself.

Comment · 11 years ago
Original source: http://int80h.org/bsdasm/

My recollection is this was published on the author's site years before being added to the "handbook" on the FreeBSD website. I could be wrong. Perhaps check archive.org.

Comment · 11 years ago
I have a question: In his analogy, what represents the hardware and what represents the software? Wouldn't the change from horses to combustion engine be a change in hardware? And software might be represented by something like the reins or a gas pedal?
Comment · 11 years ago
This is from 2012.

He's wrong of course about being the only user.

I love this software, along with k/q. I admire the work Mr. Shields has put into this project. I especially like the use of musl and provision of static binaries.

I do not use Perl, Java, Python, Javascript, Go, Rust, Closure, etc., etc. Whatever the majority of people are recommending, that is generally not what I use. It just does not appeal to me.

I guess I am stubborn and stupid: I like assembly languages, SPITBOL, k/q, and stuff written by djb. Keep it terse. Ignore the critics.

Yet this is now on the front page of HN. Maybe because it is the weekend? I really doubt that the software I like with ever become popular. But who knows? Maybe 10 years from now I will look at this post and marvel at how things turned out.

There is no "structured programming" with spitbol. No curly braces. Gotos get the job done. Personally, I do not mind gotos. It feels closer to the reality of how a computer operates.

Would be nice if spitbol was ported to BSD in additon to Linux and OSX. As with k/q I settle for Linux emulation under BSD.

Comment · 11 years ago
Beautiful response to a recurrent misunderstanding.

"Shell languages are defined by their terseness."

It is common to see people put a layer of verbosity on top of the Bourne shell (or system(3)) to make "a new shell".

It is also very common to see people put a layer of abstraction on top of a large, verbose scripting language and claim the result to be a new, "terse" language (with all the power of the shell).

But what I like about the Bourne shell is that it is built from only C. And it does not add too much verbosity. It is, as you say, defined by its terseness.

There is also terseness in the roff-like typesetting languages, assembly languages, FORTH, k/q, etc.

Compared to k/q, sh is verbose.

For me, verbosity means loss of power and loss of time.

I am glad there are terse languages.

They may never again be popular but I think they will always exist.

"The worst parts of the shell are the flow control structures..."

For some reason I dislike if/then/else. Instead I make heavy use return values, ||, test(1) and case/esac.

I always wished Bourne's shell (cf. Joy's C shell) made use of more C operators. There's a file called arith_lex.l in the Almquist sh source but these operators are not used in the sh language.

I would switch to the Plan 9 shell but Bourne sh remains more useful due to its ubiquity.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton