bash - execute binary directly from curl -
is there bash command execute binary-"stream"? there nice way load , run shell scripts straight internet.
as example:
curl http://j.mp/spf13-vim3 -l -o - | sh
is possible run binaries without saving file, chmod etc. ?
something like:
curl http://example.com/compiled_file | exec_binary
the unix kernels know expect binary executable files stored on disk. required can perform seek operations arbitrary offsets, , map file contents memory. therefore, straight executing binary stream standard input not possible.
the best can write script indirectly accomplish want, saving info temporary file.
#!/bin/sh # arrange temporary file deleted when script terminates trap 'rm -f "/tmp/exec.$$"' 0 trap 'exit $?' 1 2 3 15 # create temporary file standard input cat >/tmp/exec.$$ # create temporary file executable chmod +x /tmp/exec.$$ # execute temporary file /tmp/exec.$$
bash curl binary executable
No comments:
Post a Comment