Make and '#'

Kevin Braunsdorf ksb at nostromo.cc.purdue.edu
Thu May 9 05:41:51 AEST 1991


I've needed # in shell commands in make before.  I had to use tr(1) to
get them...  here is an example from an old Makefile....

OLDCODE= ${CC} ${CFLAGS} -E $$file |\
	 sed -n -e `echo '/^@/p' |tr "@" "\043"` |\
	 sed -e 's/^.[ 0-9]*"\(.*\)" *$$/\1/' -e '/\/usr\/include/d'


Note that 
	$ echo '/^@/p' | tr "@" "\043"
outputs
	/^#/p

which is the string I need to pass sed -e...  (yes, I know one sed would do).


--
"Anything I could have said I felt, somehow, you already knew..."
kayessbee, Kevin Braunsdorf, ksb at cc.purdue.edu, pur-ee!ksb, purdue!ksb



More information about the Comp.unix.questions mailing list