command1 takes another command (say
command2) as argument, with
command2's arguments as the remaining arguments of
command1 command2 arg...
command2 is a made up of several commands (each of which might have its own arguments and options), e.g. when
command 3; command 4 and
command 3 | command 4, how do you specify
command2 as an argument to
Does my question belong to bash,
command1, or both?
The solution I can think of is: writing
command2as a bash script and passing the script name in place of
command2as an argument to
But it seems not work in the following example:
$ torify /tmp/test-tor/download.sh /usr/bin/torsocks: 162: exec: /tmp/test-tor/download.sh: not found
where the content of
#! /usr/bin/bash curl ifconfig.me myprogram -n myarg
I also would like to know if it is possible to solve the problem without writing a script, because it seems overkill to write a script when
For example, when using
torwith a program, I want to check my external ip address by
curl ifconfig.me, before running the program
torify "curl ifconfig.me; myprogram -n myarg"
but it doesn't work.