Re: Writing some built-in functions for Bash, possible?

2017-10-21 Thread Ky-Anh Huynh via Digitalmars-d-learn
On Wednesday, 18 October 2017 at 08:15:53 UTC, evilrat wrote: [...] This isn't the actual code but should give you a hint, the rest is up to you. Woh Thanks a ton. I can have some working code after a few hours :D

Re: Writing some built-in functions for Bash, possible?

2017-10-18 Thread evilrat via Digitalmars-d-learn
On Wednesday, 18 October 2017 at 08:22:09 UTC, Andrea Fontana wrote: On Wednesday, 18 October 2017 at 03:48:01 UTC, Ky-Anh Huynh wrote: You can write your script in D using #!/usr/local/bin/rdmd as shebang line. Or, using dstep, you can convert C headers to D imports, so you can compile your

Re: Writing some built-in functions for Bash, possible?

2017-10-18 Thread Andrea Fontana via Digitalmars-d-learn
On Wednesday, 18 October 2017 at 03:48:01 UTC, Ky-Anh Huynh wrote: Hi, I'm using Bash heavily in my systems. Things become slow and slow when I have tons of scripts :) And sometimes it's not easy to manipulate data. You may have heard of recutils [1] which has a C extension to be loaded by

Re: Writing some built-in functions for Bash, possible?

2017-10-18 Thread evilrat via Digitalmars-d-learn
On Wednesday, 18 October 2017 at 08:15:53 UTC, evilrat wrote: ... extern(C) static int test_builtin(WORD_LIST* list) ... This of course should be nothrow also, because if it throws something really bad may(will) happen

Re: Writing some built-in functions for Bash, possible?

2017-10-18 Thread evilrat via Digitalmars-d-learn
On Wednesday, 18 October 2017 at 03:48:01 UTC, Ky-Anh Huynh wrote: Hi, I'm using Bash heavily in my systems. Things become slow and slow when I have tons of scripts :) And sometimes it's not easy to manipulate data. You may have heard of recutils [1] which has a C extension to be loaded by

Re: Writing some built-in functions for Bash, possible?

2017-10-17 Thread Ky-Anh Huynh via Digitalmars-d-learn
On Wednesday, 18 October 2017 at 03:48:01 UTC, Ky-Anh Huynh wrote: Some examples in C are in [2]. My experience: Dlang has `pipe` support however the syntax is not as clean as Bash :) Most of the times I see short (<1k loc) Bash scripts are easy to maintain than Ruby (and now D things)

Writing some built-in functions for Bash, possible?

2017-10-17 Thread Ky-Anh Huynh via Digitalmars-d-learn
Hi, I'm using Bash heavily in my systems. Things become slow and slow when I have tons of scripts :) And sometimes it's not easy to manipulate data. You may have heard of recutils [1] which has a C extension to be loaded by Bash. Is it possible to write similar things in D, for Bash? I am