Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • Using eval and running another full shell aren't that different. In both cases there's a full round of shell expansions etc. done. Of course, an eval happens in the same shell environment, while starting another shell starts another environment. But all the quoting complications and issues with files called $(reboot) are there. Also, here, you probably should use bash -c "$*" because -c only takes one argument. Note e.g. how the f echo a-one a-two only prints an empty line with function here. Commented Apr 14, 2021 at 19:58
  • @ilkkachu Yes, you are right. I don't look for all cases. Only want to tell the OP that's there is another way. Commented Apr 14, 2021 at 20:21