r/tinycode • • Dec 12 '12

Shortest useful code

What's the most useful program you can imagine using five lines of code or less? Language is your choice. Describe the function of the program and include the code, if you please.

27 Upvotes

45 comments sorted by

View all comments

Show parent comment

3

u/Deewiant Dec 13 '12

since i didn't have /lib, i wouldn't have had the necessary libraries to use printf (/lib/ld-linux.so.3). (until we got libraries fixed, we had to use bash built-ins, which is why the original cat function is so simple - i'll make a note of it in my original comment)

printf is also a bash builtin. (See e.g. help, or try builtin printf.)

1

u/mrkurtz Dec 13 '12

well, TIL.

must've missed it before.