Search code examples
bashcommand-linecode-golf

How do I program using cat?


In this xkcd comic: Real Programmers

they mention that real programmers use cat. Well, I was asking myself: how could you program using the cat command?


Solution

  • $ cat > hello.c
    #include <stdio.h>
    
    main(void) {
        printf("Hello, world.\n");
    }
    ^D
    $ gcc hello.c
    $ ./a.out
    Hello, world.