Ruby executes shell commands, often "," but this is a little bit of a problem, that is, this is a new sub-process, which means that if you use the ", then the entire method can only execute the shell once, if the following also depends on the results of the execution, such as new files/folders, then, Sorry, you will find no file or directory, because the goods opened a sub-process, and then immediately down execution, he will not wait for the child process to exit and then execute, there may be a folding ear cat situation: The entire script is finished, all print exit prompt, suddenly inexplicably appear shell execution results ...
To solve this problem, need to use the system of this method, the specific use case here is too lazy to write, Baidu a search will know that the advantage of this is that he only open a child shell, the shell does not quit the words will not be executed, so that you can avoid the use of "' cause problems
Questions about Ruby executing shell commands