Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Unix Way

Name: Anonymous 2011-10-02 8:59

write one small program to do one thing right
Every unix program i've seen is a monstrosity with enough options and man/info pages to drive people insane.
http://www.go2linux.org/ls-man-page

Name: Anonymous 2011-10-02 9:01

It does one thing: list files.

Name: Anonymous 2011-10-02 9:05

What's wrong with thoroughness?

Name: Anonymous 2011-10-02 9:17

>>3


It's not fun.  APPLE II was fun.  Commodore 64 was fun.  understand?


LoseThos is fun.

Name: VIPPER 2011-10-02 9:17

>>1
The ultimate truth.

Name: Anonymous 2011-10-02 9:19

LoseThos can do 3,000,000 context swaps a second on one core.  It does not touch disk on context swap -- it just saves registers, mostly.

Name: Anonymous 2011-10-02 9:34

>>1
GNU's not Unix.

Name: Anonymous 2011-10-02 9:44

LoseThos is not GPL

Name: Anonymous 2011-10-02 9:46

Name: Anonymous 2011-10-02 13:34

>>9
enjoy your segfaults and faggotry

Name: ᴍʀ. ᴠɪʟᴇ !PRoGN.piPE 2011-10-02 13:39

>talking about UNIX userspace programs
>posts a link to a GNU/Linux program man page

gg

Name: Anonymous 2011-10-02 16:26

Back to cat-v.org, uriel.

Name: Anonymous 2011-10-02 17:05

ls does do one thing and does it well. It lists files.

$ ls
file1  file2  file3  filea  fileb  filec


Or it can list a single file.

$ ls file1
file1


Or it can list several files.

$ ls file1 file2 filec
file1  file2  filec


But ls doesn't have to support wildcards because those are provided by the shell.

ls *
file1  file2  file3  filea  fileb  filec


(ls never sees the asterisk, just the files)

But what if wildcards aren't sufficient for searching and the user needs regular expressions? ls doesn't have to provide those either, because the shell provides pipes (|), and grep provides regular expressions.

$ ls | grep '^.*[1-2]$'
file1
file2


ls doesn't have to worry about saving output to a file either, because that's also provided by the shell with >.

$ ls *[a-c] > file1
$ cat file1
filea
fileb
filec


Now let's say the user wants big letters like those provided by figlet?

$ figlet big text
 _     _         _            _  
| |__ (_) __ _  | |_ _____  _| |_
| '_ \| |/ _` | | __/ _ \ \/ / __|
| |_) | | (_| | | ||  __/>  <| |_
|_.__/|_|\__, |  \__\___/_/\_\\__|
         |___/


Should ls provide it? No, because figlet will gladly provide it to ls.

$ ls *[1-3] | figlet
  __ _ _      _
 / _(_) | ___/ |
| |_| | |/ _ \ |
|  _| | |  __/ |
|_| |_|_|\___|_|
               
  __ _ _      ____ 
 / _(_) | ___|___ \
| |_| | |/ _ \ __) |
|  _| | |  __// __/
|_| |_|_|\___|_____|
                   
  __ _ _      _____
 / _(_) | ___|___ /
| |_| | |/ _ \ |_ \
|  _| | |  __/___) |
|_| |_|_|\___|____/


Want ls to list files by a cow? Pipe it through cowsay.

$ ls file[a-c] | cowsay
 ___________________
< filea fileb filec >
 -------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||


Wanna rot13 it?

$ ls | rot13
svyr1
svyr2
svyr3
svyrn
svyro
svyrp


Want the cow to rot13 it?

$ ls *[1-3] | rot13 | cowsay
 ___________________
< svyr1 svyr2 svyr3 >
 -------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||


Want to have a program where the cow tells you your fortune?

$ cat > cowfortune
fortune | cowsay
$ chmod +x cowfortune
$ mv cowfortune ~/bin
$ cowfortune
 ______________________________________
/ You look like a million dollars. All \
\ green and wrinkled.                  /
 --------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||


Do you get the idea? The UNIX philosophy to do one thing and do it well means that ls need not worry about every possible way to list files, and figlet, cowsay and rot13 need not know anything about listing files.

ls is an exception however, since it is THE most commonly used tool, therefore it provides some of its own conveniences like sorting, etc.

If you think Apple ][ and Commodore 64 are funner than UNIX, you're an accountant or a gamer, not a hacker, and you should probably go back to /g/.

Name: Anonymous 2011-10-02 18:45

>>13
10/10 post. I orgasmed just by reading it. Now if you excuse me, I have to go change my pants.

Name: Anonymous 2011-10-02 18:54

>>13
Not sure whether this is kopipe, but kudos for posting it. I am going to send this to someone every time they don't understand doing things the `UNIX way' (I'm sick of explaining it).

Name: Anonymous 2011-10-02 19:17

GNU ls: 59 options
BSD ls: 39 options
POSIX ls: 23 options
Plan9 ls: 12 options

DOS dir: 14 options

Name: Anonymous 2011-10-02 20:09

>>16
GNU cat: 9 options
Plan 9 cat: 0 options

I love you, Plan 9 (Plan 9 users: do `man emacs').

Name: Anonymous 2011-10-02 21:04

In the future all binaries will be linked in a huge busybox-like blob.

Name: Anonymous 2011-10-02 22:23

Are you retarded hipsters really praising lack of options and choice?

Your software must be complete shit.

Name: Anonymous 2011-10-02 23:04

>>11
It's not GNU/Linux, it's just GNU.

>>1
It's a philosophy, not a rule.

Name: Anonymous 2011-10-03 3:06

>>19
Have you ever tried sam? Imagine vim but you have to click the mouse every time you type a command. It's better!

Name: Anonymous 2011-10-31 22:32

>>21
acme master race

Name: Anonymous 2011-11-01 0:32

>>17
>>16
impliying that # of options == bloat

Name: Anonymous 2011-11-01 0:33

>>21
clicking a mouse... better
[m] 凸⏝(ˋ⁔ˊ)⏝凸 [/m ]

Name: Anonymous 2011-11-01 0:35

>>23
It's called `feature bloat' or `featuritis'. JWZ's Law of Software Envelopment:
Every program attempts to expand until it can read mail. Those programs which cannot so expand are replaced by ones which can.

Name: Anonymous 2011-11-01 0:50

why not just compile the BSD coreutils source for Noobuntu?

Name: Anonymous 2011-11-01 1:04

>>26
I think most Linux distributions depend on GNU coreutils.

Name: Anonymous 2011-11-01 1:49

>>25
the # of options has nothing to do with option of unix programs

the option usually change the semantics of the function of the programs but don't agregate functions. a fine example of this is the "grep -c PATTERN" the use is the same, the semantics change from display text to count ocurrences on files. BTW one could argue the true intended use of grep is for "ocurrences of text"

Name: Anonymous 2011-11-01 3:42

>>25

maybe this law could be updated to be about building the program until it can display web content? (itunes, steam for example)

Name: Anonymous 2011-11-01 4:05

>>29

indeed so... most indeedly.

more and more we're seeing programs using webkit or some alternative to write the UI in HTML + javascript.

Name: Anonymous 2011-11-01 6:00

>>13
That's one impressive post.
I'm not going back to /g/ you guys rule

Name: Anonymous 2011-11-01 11:46

>>31
BACKSTOP EAGLE

Name: Anonymous 2011-11-01 16:28

<-----

(dubs)

Name: Anonymous 2011-11-01 19:08

>>32
fuck you fagstorm

Name: Anonymous 2013-09-01 14:18



:::::::::: ::::: ::: :: : : : ,. -─- 、                                 /
::::: ::::: ::: :: : : : ,.'´     `ヽ.                              ,'   仲
::::: ::: :: : : :  /      ノ、    ':,                             i.    間
:: ::: :: : : :  ,'     ,.'ヽ:ヽ    ':,           ,..-‐- 、       ,. -─- 、!    を
::: :: : : :   |   /  !::ヽ.   i         /     ':,     ,.'      ',   見
:: : : :     !  /    !:::::::!   ,'        ,.'  i      ヽ.   i   故   i   捨
: : :      レ'      !::::::/  .,.'         ,'   |      ':,   !  .郷   |   て
: :             ,':::::;' /-─- 、.,_   /  /:!       i  |   を   ト、
:            ,. ' !:::/o/        `''ァ'  /::::::',.       ,'  !  捨   | `'' ー
          /  ,レ'"´         /  /:::::/ヽ、     /   .!  て   |
        , '  / ,          ,'o /:::::/ヽ.  `ヽ,  /  ∠  て  ,'
        /   ,.'  /          ヽ/;:イ   ':,    レ'     `ヽ、___,.: '
      _ノ,  ./  ,' /!  /!    ',    ,       ',           ,. -────-
       `'i ,'  .!/_`i'ー/::|   ;   !   i  ;     i         /
   ,. -    レヘ.  ! i. |`゙ト、! /:| 、/|   !   i     |        ,'   破 幸 地 そ
   '、.,,____    iヽ、!,ヘ ゞソ レ'::::::レ'`'iー- /!  ハ  i.  i.       i   廉 せ 上 れ
    、.,___    ! /7"''       ´i`゙'ト、'_.| / i  ,ゝ  |      <   恥 を. の な
          Y ,ヘ   '       '、_ン_ノ!,イ /V´  i !       .!   な 感 生 の
         ,'  ノヽ.   r-、   ,.,.´/ / |   | |  彡    !   女. じ 活 に
        / /;:/:::;iヽ.  ┘   /  ,.:'  .!   | !        |   か て に
:       ,' ,イ/::/:::::::! /ゝ,--‐=7´  ,.イヽ. ,'    ||         !    も  し
: :         レ' /'!ヽ>、:::::!'/ヽ.  /! /;::::::::::`;ゝ、  |        |.   知. ま
::: : : :      ,'  !::!7::::::::!7´Y'ヽ/ レ'く´::::::::::::/:::::::ヽ. !        !   れ. う
:::: : : : :   /  !::i';::::::::::!⌒ソ/::::::::/::::::::::::;:'::::::::::::::::'; ',         |   な  私
:::::: ::: : : :  ,'   .!::!:';::::::::|_/イ::::::::::::/::::::::::::/::::::::::::::::::::i ',       !.  い  は
:::::::: :::: : : : i   /::::!::';::::::レ'::::::::::::/::::;、:;__::i:::::::::::::::::::::::',. ヽ、      '、

Name: Anonymous 2013-09-01 15:50



               _,,... -─- 、.,___
          ,.- 、/´  ( L )    `ヽ、 __
         _,,.! ‐'' "´ ̄`"'' ー- 、.,__   7´:.:.:`ヽ.
        ;´         __,,.. -=ニ二i:.:y⌒ヽ:.:';
        ';   __,,..-‐:.''" ̄.:.:.:.:_」__';:.:.::.':;8:.:.::.ノ:.:.:i
       ;'^y'´.:.:.i:.:.:!:.:__」_ト、:.:.:.:.!:._」_:.:.:i:.i ニ.:.:.:.::.:.:!、
        ):/:/:.;':.:!:.:.!.:.:__!;」 ヽ,ァ´,.‐,、ヽ|:.ト、:.:.:.:.:.:.Y    ,-、     :::
       〈:.:レi:.:.i:.:.:';:.:!ァ´,-、     ト-' リ 〉:.リ:.ヽ、:.:.:.ヽ.,   ,':::::!     ::::::
        ヽ:i_;ハ__;:ヘハ ト' !    'ー' ´ |:.|:.:.:.!ハ:.:.:.:.:iヽ. l:::::::',  ミ  ::::::
        7´:.ノ /:./!` `'´     "'"'ソ:.:!:.:.:.:.;ハ.:.:.:ノ:.:.;ゝヽ、::',     :::
        レ'´、_,!ィ':人''"   ー-‐'   ,イ:.ノ:.:.:.ノ レ'"ヽ、ノ   `ヽ.    :
        ´    )ノ:.:.:ノ> .、..,___,,. イ、レ'レ'"_,,..,,_          ':,   :
            )ノ´  ,.rイ!、__,.イ_  >ァ、:::::::::`ヽ.        ',  :  ミ
                ,rく  /Mヽ.   r'ン  `ヽ、:::::::i        |  '     
               / }ン'ヽ、゜゜ _ン'´  y    ヽ_」ヽ、        ! '   ,. '"
             ,.ヘ. /   Q'´     i    r'コ、::::::::':,     ,'  . '
          _,/  `i   ノFヽ、     ',    \ノヽ、:::::i   / /
       _rァ'"´ ´   く`ー'" ハ   ` ''ー--ヘ        `ア7'つ'、
     ,.ィ´i        !>、.,/ニ!      ,ハゝ、      // 7´   !
    (_ヘ. '、     _/  7  `Tァー-‐''" ヽ. ヽ、,    _」」、'、___ノ
    ノ!'ーヽ'ー--=ン´    /    !       \  `''<:::::::::|
   / ノ!   r'"´                    くヽ;:::::::ノ
   レ'/   ノ /ヽ、   /               ,.へ \>i'
    ノ!   / 〈`ヽ、_>        |    ____ く/`ヽ  /
  (/    `ヽ.`ー‐' / 「二>  ______  「ー ''"i  ヽ、ノ ノ
          ` ̄7`ヽ!____」  |ー‐‐'i  ヽ、__ノ  ___ノ´
          rァ'  /、`ヽ、.,  L____」 ______,,./´  
          ! `ー ' 7    `'' ー-‐'´!   |、
          ,'    /        「`ー-'7
         ,'    ,'         !.    |
         /´ ̄`ヽ!         /´ ̄` !
         ト、.,_____ノ!        i    ,i
         `ー--‐'"         ヾ二ニン

Don't change these.
Name: Email:
Entire Thread Thread List