make C is scriptable like D

dangbinghoo dangbinghoo at gmail.com
Thu Jun 20 06:20:17 UTC 2019


hi there,

a funny thing:

--------------------------------
$ cat rgcc
#!/bin/sh
cf=$@
mycf=__`echo $cf|xargs basename`
cat $cf | sed '1d'  > ${mycf}
gcc ${mycf} -o a.out
rm ${mycf}
./a.out

$ cat test.c
#!/home/user/rgcc
#include <stdio.h>
int main()
{
     printf("hello\n");
}
--------------------------------

And then,

----------------
chmod +x test.c
./test.c
----------------

output hello.

is rdmd implemented similarly?

thanks!

----
binghoo



More information about the Digitalmars-d-learn mailing list