Posts from the ‘Kode Sumber Perintah’ Category

Koleksi Kode Sumber (17) : MINIX (5) – Perintah chmod



/*
* chmod [mode] files
*  change mode of files
*
*  by Patrick van Kleef
*/

Baca lebih lanjut…

Koleksi Kode Sumber (16) : MINIX (4) – Perintah cc



/*    $Header: cc.c,v 1.2 86/08/26 09:40:10 erikb Locked $
Driver for the CEMCOM compiler: works like /bin/cc and accepts the
options accepted by /bin/cc and /usr/em/bin/ack.
Derived from: "cem.c,v 1.5 86/01/20 11:10:29 erikb Exp"

Date written: Dec 4, 1985
Adapted for PC/IX on Jan 20, 1986
Strongly reduced (May 14, 1986)
Piping output from cpp into cem (Jul 30, 1986)
Create temporary files in TMP directory (Aug 6, 1986)
Pass hint for optimization to cg (Aug 15, 1986)
Throw away intermediate files on interrupts (Aug 15, 1986)
Print file name if there are more than one source files (Sep 22, 1986)
Author: Erik Baalbergen
*/

Baca lebih lanjut…

Koleksi Kode Sumber (15) : MINIX (3) – Perintah cat



/* cat - concatenates files          Author: Andy Tanenbaum */

Baca lebih lanjut…

Koleksi Kode Sumber (14) : MINIX (2) – Perintah basename



/* basename - print the last part of a path:    Author: Blaine Garfolo */

#define NULL 0

main(argc,argv)

int argc;
char *argv[];
{
int j,suflen;
char *c;
char *d;
extern char *rindex();

if (argc < 2)     {
std_err("Usage: basename string [suffix]  \n");
exit(1);
}
c=argv[1];
d = rindex(argv[1],'/');
if (d == NULL)
d = argv[1];
else
d++;

if (argc == 2) {       /* if no suffix */
prints("%s \n",d);
exit(0);
} else {            /* if suffix is present */
c = d;
suflen = strlen(argv[2]);
j = strlen(c) - suflen;
if (strcmp(c+j, argv[2]) == 0) *(c+j) = 0;
}
prints("%s \n",c);
}


Koleksi Kode Sumber (13) : MINIX (1) – Perintah ar



/* ar - archiver        Author: Michiel Huisjes */

/*
* Usage: ar [adprtvx] archive [file] ...
*      v: verbose
*      x: extract
*      a: append
*      r: replace (append when not in archive)
*      d: delete
*      t: print contents of archive
*      p: print named files
*/

Baca lebih lanjut…

%d blogger menyukai ini: