Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bash as a C lib? [closed]

Tags:

c

bash

I've got a project where I want to do some stuff that would be trivial in bash but where I want/need a binary with has zero external dependencies. So, has anyone written a self contained lib (i.e. not a wrapper around system()) that lets you do bash like stuff from inside C?

Off hand, the things I expect to need are: cp, rm, wget, tftp, ar, tar, guzip and maybe dpkg but I think I can side step that one.


To answer the comments: I'm looking for something along the lines of a statically linked busy-box but where I don't need a shell file as a program for it and where things I don't use automatically don't even get linked in.

like image 349
BCS Avatar asked Dec 06 '25 08:12

BCS


1 Answers

You need busybox.

like image 77
Diego Torres Milano Avatar answered Dec 07 '25 22:12

Diego Torres Milano



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!