9fans archive / 1996 / 04 / 28 /    prev next

From: Min Huang mhuang@CS....
Subject: plan9 sed
Date: Tue, 9 Apr 1996 15:09:52 -0400

Hi:
	I tried to convert the following Unix script to Plan9 script.
	In Unix, I got the following Unix Output File.
	I have a problem to get plan9 script to work.       

	Thank you very much

************** Unix script *************************************************
	eval cc -E a.c | sed -n -e 's%^# [1-9][0-9]* "\./\(.*\)".*$%\1%p' -e 's%^# [1-9][0-9]* "\(.*\)".*$%\1%p' | sort -u 
******************************************************************************

************** Plan9 script *************************************************
        eval pcc -E a.c | sed -n -e 's%^# [1-9][0-9]* "\./\(.*\)".*$%\1%p' -e 's%^# [1-9][0-9]* "\(.*\)".*$%\1%p' | sort -u 
******************************************************************************

************** a.c *************************
#include <stdio.h>
#include <stdlib.h>

main()
{
        printf("Hello Horus\n");
}
********************************************

************ Unix Output File **************
/usr/include/stdio.h
/usr/include/stdlib.h
/usr/include/sys/stdtypes.h
a.c
********************************************