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

Pages: 1-

itt: your own command line

Name: Anonymous 2009-08-30 22:27

#template:
while 1:
    inp = raw_input('>')
    if inp=='help':
        print'FUCK YOU'

Name: Anonymous 2009-08-30 22:31

(loop (print (eval (read))))

Name: Anonymous 2009-08-30 22:34

>>2
/thread

Name: Anonymous 2009-08-30 22:35

christopher@chrislaptop$ bash
bash-3.2$ _

Name: Anonymous 2009-08-30 22:35

/* Anonix ed - public domain */

#include <limits.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

void int_handler(int);
void hup_handler(int);

char *prompt = "";

int main(int argc, char **argv){
  char line[LINE_MAX];
  int c;
  while((c = getopt(argc, argv, "p:s")) != -1)
    switch(c){
      case 'p':
        prompt = optarg;
        break;
      case 's':
        break;
      case '?':
        printf("Usage: %s [-p string] [-s] [file]\n", argv[0]);
        return EXIT_FAILURE;
      default:
        abort();
    }
  signal(SIGINT, &int_handler);
  signal(SIGHUP, &hup_handler);
  signal(SIGQUIT, SIG_IGN);
  for(
    fputs(prompt, stdout) && fflush(stdout);
    fgets(line, LINE_MAX, stdin) && strcasecmp(line, "q\n");
    printf("?\n%s", prompt) && fflush(stdout));
  return 0;
}

void int_handler(int n){
  fpurge(stdin);
  printf("\n?\n%s", prompt);
  fflush(stdout);
}

void hup_handler(int n){
  _Exit(0);
}

Name: Anonymous 2009-08-30 22:52

>>5
Anonix
W-{

Name: Anonymous 2009-08-30 23:11

#include <limits.h>
#include <stdlib.h>
#include <string.h>

char *getline(char *prompt);

int main(void){
  for(char *line = "";
      strcmp(line, "exit\n");
      system(line))
    line = getline("$ ");
  return 0;
}

Name: Anonymous 2009-08-30 23:39

>>5
fpurge is not standard and not async-safe. You can't use it from a signal handler.

Name: Anonymous 2009-08-31 1:22

>>8
He also tries to write to a constant char ptr.

char* prompt = "";
Obviously WHBT.

Name: Anonymous 2009-08-31 8:25


    while 1:
        inp = raw_input('> ')
        if inp=='help':
            print 'OP is a fag'
        else
            print 'OP is really a fag'

Name: Anonymous 2009-08-31 11:32

INDENTATION ERROR

Name: Anonymous 2009-08-31 20:36

>>9
pointer to const ≠ const pointer

>>8
my fpurge is async-safe. get a real operating system.

Name: Anonymous 2009-09-01 9:54

>>12
Is that a guarantee?

Name: Anonymous 2009-09-01 17:07

>>13
yes, it is.

Name: Anonymous 2009-09-01 17:10

>>12
Nobody cares about fpurge().

Name: Anonymous 2009-09-01 17:12

>>15
except for your mother, who uses it after every meal.

Name: Anonymous 2010-11-28 16:06

Name: Anonymous 2013-01-19 23:40

/prog/ will be spammed continuously until further notice. we apologize for any inconvenience this may cause.

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