DataMuseum.dk

Presents historical artifacts from the history of:

Commodore CBM-900

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Commodore CBM-900

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦aca39a43f⟧ TextFile

    Length: 490 (0x1ea)
    Types: TextFile
    Notes: UNIX file
    Names: »echo.c«

Derivation

└─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code
    └─⟦f4b8d8c84⟧ UNIX V7 Filesystem
        └─ ⟦this⟧ »cmd/echo.c« 

TextFile



/*
 * echo -- print command line arguments
 */
#include	<stdio.h>


#define	bool	char
#define	TRUE	(0 == 0)
#define	FALSE	(not TRUE)
#define	not	!


main( argc, argv)
register char	**argv;
{
	char	obuf[BUFSIZ];
	bool	newline;

	setbuf( stdout, obuf);
	newline = TRUE;
	if (*++argv && strcmp( *argv, "-n")==0) {
		++argv;
		newline = FALSE;
	}

	while (*argv) {
		fputs( *argv++, stdout);
		if (*argv)
			putchar( ' ');
	}

	if (newline)
		putchar( '\n');
	fclose( stdout);
	return (0);
}