[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y ] [Search | Home]
4Archive logo
To understand Unix, you must understand why...
If images are not shown try to refresh the page. If you like this website, please disable any AdBlock software!

You are currently reading a thread in /g/ - Technology

Thread replies: 32
Thread images: 2
To understand Unix, you must understand why a program that does nothing and fails at it is a required system utility.

Discuss.
>>
It's really rather basic, so yes, if you don't understand it, you don't understand Unix.
>>
>fails at it

This wording to me suggests you do not understand Unix.
>>
>>52233768
And that is one reason why most shells in their current forms are retarded.
/thread
>>
>>52233912
>Exit with a status code indicating failure.
>do nothing, unsuccessfully
Failing is the intergral purpose of the program. I'm not sure how else to word it.
>>
Why do I have this? It's supposed to exit with a status code indicating failure according to the man-page, but it just runs and give no error codes or failure codes. With the --version flag it is supposed to "output version information and exit", but it outputs nothing it just runs with no output. I don't understand this. Why have a core system utility that fail at what the man page says it will?

I know the unix philosophy "Do one thing and do it well" and the job of this utility is to indicate faliure, and it makes sense that it fails doing what the man page says it will do, but what is the point? Is it some inside joke? a nerdy easter egg for people who know enough about unix to "get it"? I must be stupid, because I don't understand
>>
>>52233768

>I know absolutely nothing about technology but feel compelled to talk about it

Normies pls go.
>>
>>52234089
It works exactly as it's supposed to. You do realise that your terminal probably isn't set up by default to alert you of status codes indicating failure?
>>
>>52234172
>outputs 1
>this is somehow useful information to anyone

linuxcucks on suicide watch
>>
>>52234466
b8
>>
>>52233768
>do nothing, unsuccessfully.
It's finally happened, I've been obsoleted by a computer program!
>>
>>52234466
It's useful for shell scripting. You Windows kiddies wouldn't know what that is would ya?
>>
>>52233768
Your shell comes with a lot of built-in shit for handling batch scripts.
You have to understand that every command in bash is literally a program.
When you use if else statements in a shell script, you're literally calling a program called if, else, fi, etc.

This is why bash scripting is so slow and should never be used for anything more than a quick one-liner, you're spawning a process with every command you use.
>>
>>52235506
Bash is perfect, quick and easy for simple jobs not needing performance.
Worrying about a few Kb processes spawning for a few seconds would be a topic worth discussing when in 1994
>>
>>52235540
oh yeah, that's why I tried bruteforcing md5sums using md5sum piped into sed
the program never finished
meanwhile, my C version finished in 8 seconds

i was looking for the first random seed value that produces a md5 hash that starts with at least 6 leading zeros.
>>
>>52235565
>simple jobs not needing performance
>bruteforcing hash collisions
Nice bait.
>>
>>52233768
>what is the everything-is-a-file philosophy?
please to run, ASAP: sudo rm -rf /dev
>>
>>52234089
--version doesn't work because modern shells implement 'false' as builtin keyword. Try this instead
/usr/bin/false --version


you can also check:
which false
>>
>>52233768
>GANOO/false
>290 sloc
>BSD/false
>5 sloc
GANOOfaggots BTFO.
>>
>>52235998
its actually only 2 lines:
#define EXIT_STATUS EXIT_FAILURE
#include "true.c"


BSD fags btfo
>>
>>52235671
How should you process ? Reverse engineering ?
>>
>>52236049
>#include "true.c"
>le trickster face xd
>>
>>52235437
underrated post
>>
>>52235506
if, else, and fi are not programs, you mong. they are built-in bash commands
>>
>>52236225
he meant that bruteforcing does require performance
>>
>>52236669
Have you ever tried looking at the source code of if/else/fi ?
>>
>>52236897
you mean the source code of bash?
>>
>>52235998
Until ~8 weeks ago, true and false on OpenBSD were 1 SLOC each. They were shell scripts. All they did was exit 0 or 1.
>>
>>52238064
>Until ~8 weeks ago
Did it change?
>>
>>52236233
Thats actually false.c senpai, no trickstery involved.
>>
>>52238166
any program can be "1 sloc" if that line imports another source file
>>
>>52238075
Yes, they are now 5SLOC of C.
Thread replies: 32
Thread images: 2
Thread DB ID: 367508



[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y] [Search | Home]

[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y] [Search | Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the shown content originated from that site. This means that 4Archive shows their content, archived. If you need information for a Poster - contact them.
If a post contains personal/copyrighted/illegal content, then use the post's [Report] link! If a post is not removed within 24h contact me at [email protected] with the post's information.