LD_PRELOAD in rlwrap?

166 views Asked by At

When I do something in my script like

rlwrap -f words.txt LD_PRELOAD=mylib.so command "$@" 

I always get something like

rlwrap: error: cannot execute LD_PRELOAD=mylib.so no such file or directory 

Even though that file totally exists and removing rlwrap would work just fine.

How do I put LD_PRELOAD in rlwrap? basically I want to make mylib.so apply to my 'command' only.

I did try putting LD_PRELOAD=mylib.so in from of rlwrap, it runs, but LD_PRELOAD didn't apply to command as I wished.

1

There are 1 answers

2
hek2mgl On BEST ANSWER

You can wrap the command in a shell:

rlwrap -f words.txt bash -c 'LD_PRELOAD=mylib.so command "$@"' - "$@"