[comp.lang.c] Re2: Small introspective program

leo@s514.ipmce.su (Leonid A. Broukhis) (03/13/91)

In article <1991Mar10.231230.17301@casbah.acns.nwu.edu>
olsen@casbah.acns.nwu.edu (Jeff Olsen) writes:
>
>sure...
>
>*a="*a=%c%s%c;main(){printf(a,34,a,34);}";main(){printf(a,34,a,34);}
>
>I tried it with MSC 6.0 and whatever the default cc is on a encore
>multimax.  GCC doesn't appear to like it, though.
>
	Especially gcc -ansi -pedantic !!

	I don't like even int*a= ...., because I tried it on a word-oriented
machine, which has different forms of int* and char* ...

-- 
Leonid A. Broukhis | 89-1-95 Liberty St. | "BROUKHIS" is Hebrew for
7+095 494.6241 (h) | Moscow 123481 USSR  |       "BENEDICTAE"
7+095 132.9475 (o) | (leo@s514.ipmce.su) | {Licet omnia qualibet dicas}

dconway@hpldsla.sid.hp.com (Dan Conway) (03/14/91)

/ hpldsla:comp.lang.c / scotth@corp.sgi.com (Scott Henry) /  4:54 am  Mar 12, 1991 /

> And in any sh|csh|tcsh on unix, this one is about as short as you can get:

> cat $0

This doesn't work; gives:

No file for $0                  (csh)
cat: cannot open sh: Error 0    (sh)

> --
>  Scott Henry <scotth@sgi.com> / Traveller on Dragon Wings

Dan Conway
dconway@hp-sde.sde.hp.com

peter@ficc.ferranti.com (Peter da Silva) (03/15/91)

If you want to be silly:

	% history | tail -1 | sed 's/ *[0-9]*[ 	]*//'
	history | tail -1 | sed 's/ *[0-9]*[ 	]*//'
-- 
Peter da Silva.  `-_-'  peter@ferranti.com
+1 713 274 5180.  'U`  "Have you hugged your wolf today?"

dave@cs.arizona.edu (Dave P. Schaumann) (03/15/91)

In article <2170005@hpldsla.sid.hp.com> dconway@hpldsla.sid.hp.com (Dan Conway) writes:
|/ hpldsla:comp.lang.c / scotth@corp.sgi.com (Scott Henry) /  4:54 am  Mar 12, 1991 /
|
|> And in any sh|csh|tcsh on unix, this one is about as short as you can get:
|
|> cat $0
|
|This doesn't work; gives:

You have to have it in a file.  It doesn't work as an interactive command.

-- 
Dave Schaumann | dave@cs.arizona.edu | Short .sig's rule!

rjohnson@shell.com (Roy Johnson) (03/18/91)

In article <_N=9QX3@xds13.ferranti.com> peter@ficc.ferranti.com (Peter da Silva) writes:
   If you want to be silly:

	   % history | tail -1 | sed 's/ *[0-9]*[ 	]*//'
	   history | tail -1 | sed 's/ *[0-9]*[ 	]*//'
Try:
% history -h 1
history -h 1

Sorry about the inappropriateness.  "He started it!"
--
======= !{sun,psuvax1,bcm,rice,decwrl,cs.utexas.edu}!shell!rjohnson =======
Is this the appropriate newsgroup to post about what's appropriate to post?
Roy Johnson, Shell Development Company