bash: executing an output of a script as a script

后端 未结 2 752
长情又很酷
长情又很酷 2020-12-17 00:11

I\'m writing a simple script to generate all combinations of a and b of a given length (say 10). I want to be able to do this on a command line (I know this is fairly easy i

2条回答
  •  無奈伤痛
    2020-12-17 01:03

    You need to use an eval, $() gives you a string.

    eval $( echo echo foo )
    

    Another option is to stick into a subshell and pipe it to a bash:

    (echo echo foo) | /bin/bash
    

提交回复
热议问题