make C is scriptable like D

Cym13 cpicard at openmailbox.org
Thu Jun 20 16:24:25 UTC 2019


On Thursday, 20 June 2019 at 06:20:17 UTC, dangbinghoo wrote:
> 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

Basically, yeah.


More information about the Digitalmars-d-learn mailing list