vserver Howto/FAQ

Howto index

Execution of commands with wild-cards

I would like to execute a command using the /usr/sbin/vserver front-end, but I would like to see the shell wild-card expanded on the other side (inside the vserver).

If you do

/usr/sbin/vserver server exec command \*

You end up with \* passed to the command directly, without shell expansion. The /usr/sbin/vserver front-end is preserving the arguments as much as possible. So if you escaped something to prevent shell expansion, it will remain that way.

The trick is to use a shell on the other side (in the vserver). The command is simply rewritten like this:

/usr/sbin/vserver server exec /bin/sh -c "command *"