Is it possible to run bash builtin from non bash script?

Posted by tig on Super User See other posts from Super User or by tig
Published on 2010-12-22T08:44:52Z Indexed on 2010/12/22 8:55 UTC
Read the original article Hit count: 389

Filed under:
|

Is it possible to run for example history -w for underlying bash shell from ruby script?
Or better is it possible to run builtin command for bash shell knowing only its pid?

The only way I found is to trap signal like trap "history -w" SIGUSR1 and then send signal to process, but I am not sure that it is a good practice and USR1 is not used by bash, also this way I can execute max 2 commands (USR1 and USR2). And I have to define trap before using it.

I am on Mac so there is not SIGRTMIN..SIGRTMAX.

© Super User or respective owner

Related posts about osx

Related posts about bash