Skip to main content
added 2 characters in body
Source Link
Tim
  • 106.9k
  • 234
  • 651
  • 1.1k

Suppose command1 takes another command (say command2) as argument, with command2's arguments as the remaining arguments of comman1, i.e.

command1 command2 arg... 

When command2 is a made up of several commands (each of which might have its own arguments and options), e.g. when command2 is command 3; command 4 and command 3 | command 4, how do you specify command2 as an argument to command1?

Does my question belong to bash, command1, or both?

  1. The solution I can think of is: writing command2 as a bash script and passing the script name in place of command2 as an argument to command1.

    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 /tmp/test-tor/download.sh is:

    #! /usr/bin/bash curl ifconfig.me myprogram -n myarg 
  2. 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 command2 is short.

    For example, when using tor with 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.

Suppose command1 takes another command (say command2) as argument, with command2's arguments as the remaining arguments of comman1, i.e.

command1 command2 arg... 

When command2 is a made up of several commands (each of which might have its own arguments and options), e.g. when command2 is command 3; command 4 and command 3 | command 4, how do you specify command2 as an argument to command1?

Does my question belong to bash, command1, or both?

  1. The solution I can think of is: writing command2 as a bash script and passing the script name in place of command2 as an argument to command1.

    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 /tmp/test-tor/download.sh is:

    #! /usr/bin/bash curl ifconfig.me myprogram -n myarg 
  2. 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 command2 is short.

    For example, when using tor with 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.

Suppose command1 takes another command (say command2) as argument, with command2's arguments as the remaining arguments of comman1, i.e.

command1 command2 arg... 

When command2 is a made up of several commands (each of which might have its own arguments and options), e.g. when command2 is command 3; command 4 and command 3 | command 4, how do you specify command2 as an argument to command1?

Does my question belong to bash, command1, or both?

  1. The solution I can think of is: writing command2 as a bash script and passing the script name in place of command2 as an argument to command1.

    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 /tmp/test-tor/download.sh is:

    #! /usr/bin/bash curl ifconfig.me myprogram -n myarg 
  2. 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 command2 is short.

    For example, when using tor with 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.

added 415 characters in body
Source Link
Tim
  • 106.9k
  • 234
  • 651
  • 1.1k

Suppose command1 takes another command (say command2) as argument, with command2's arguments as the remaining arguments of comman1, i.e.

command1 command2 arg... 

When command2 is a made up of several commands (each of which might have its own arguments and options), how do you specify it as an argument toe.g. when command1command2? The solution I can think of is: writing command2command 3; command 4 as a bash script and passing the script name in place of command 3 | command 4, how do you specify command2 as an argument to command1. But I would like to know if it is possible without writing a script, because it seems overkill to write a script when command2 is short.?

For example, when using tor with a program, I want to checkDoes my external ip address byquestion belong to bash, curl ifconfig.mecommand1, before running the programor both?

torify "curl ifconfig.me; myprogram -n myarg" 

but it doesn't work.

  1. The solution I can think of is: writing command2 as a bash script and passing the script name in place of command2 as an argument to command1.

    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 /tmp/test-tor/download.sh is:

    #! /usr/bin/bash curl ifconfig.me myprogram -n myarg 
  2. 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 command2 is short.

    For example, when using tor with 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.

Suppose command1 takes another command (say command2) as argument, with command2's arguments as the remaining arguments of comman1.

When command2 is a made up of several commands (each of which might have its own arguments and options), how do you specify it as an argument to command1? The solution I can think of is: writing command2 as a bash script and passing the script name in place of command2 as an argument to command1. But I would like to know if it is possible without writing a script, because it seems overkill to write a script when command2 is short.

For example, when using tor with 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.

Suppose command1 takes another command (say command2) as argument, with command2's arguments as the remaining arguments of comman1, i.e.

command1 command2 arg... 

When command2 is a made up of several commands (each of which might have its own arguments and options), e.g. when command2 is command 3; command 4 and command 3 | command 4, how do you specify command2 as an argument to command1?

Does my question belong to bash, command1, or both?

  1. The solution I can think of is: writing command2 as a bash script and passing the script name in place of command2 as an argument to command1.

    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 /tmp/test-tor/download.sh is:

    #! /usr/bin/bash curl ifconfig.me myprogram -n myarg 
  2. 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 command2 is short.

    For example, when using tor with 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.

added 57 characters in body
Source Link
Tim
  • 106.9k
  • 234
  • 651
  • 1.1k

Suppose command1 takes another command (say command2) as argument, with command2's arguments as the remaining arguments of comman1.

When command2 is a made up of several commands (each of which might have its own arguments and options), how do you specify it as an argument to command1? The solution I can think of is: writing command2 as a bash script and passing the script name in place of command2 as an argument to command1. But I would like to know if it is possible without writing a script, because it seems overkill to write a script when command2 is short.

For example, when using tor with a program, I want to check my external ip address by curl ifconfig.me, before running the program

torify "curl ifconfig.me; myprogram"myprogram -n myarg" 

but it doesn't work.

Suppose command1 takes another command (say command2) as argument, with command2's arguments as the remaining arguments of comman1.

When command2 is a made up of several commands, how do you specify it as an argument to command1? The solution I can think of is: writing command2 as a bash script and passing the script name in place of command2 as an argument to command1. But I would like to know if it is possible without writing a script, because it seems overkill to write a script when command2 is short.

For example, when using tor with a program, I want to check my external ip address by curl ifconfig.me, before running the program

torify "curl ifconfig.me; myprogram" 

but it doesn't work.

Suppose command1 takes another command (say command2) as argument, with command2's arguments as the remaining arguments of comman1.

When command2 is a made up of several commands (each of which might have its own arguments and options), how do you specify it as an argument to command1? The solution I can think of is: writing command2 as a bash script and passing the script name in place of command2 as an argument to command1. But I would like to know if it is possible without writing a script, because it seems overkill to write a script when command2 is short.

For example, when using tor with 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.

Source Link
Tim
  • 106.9k
  • 234
  • 651
  • 1.1k
Loading