That depends on the shell being invoked to execute the commands, but in general most shells use ;
to separate commands so something like this should work:
command1; command2; command3
[EDIT]
As @dicroce mentioned, you can use &&
instead of ;
which will stop execution at the first command that returns a non-zero value. This may or may not be desired (and some commands may return non-zero on success) but if you are trying to handle commands that can fail you should probably not string multiple commands together in a system() call as you don't have any way of determining where the failure occured. In this case your best bet would either be to execute one command at a time or create a shell script that performs the appropriate error handling and call that instead.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…