1. ``
The Backtick
1. a) %x{}
Percent X < alternate syntax for The Backtick
2. system()
3. fork()
4. open()
4.a. IO.popen()
< behaves the same as open()
4.b. open("|-")
4.c. IO.popen("-")
< behaves the same as open("|-")
5. Open3.popen3()
require 'open3'
- stdlib Open3
6. PTY.spawn()
7. Shell.transact()
require 'shell'
- stdlib Shell
When should one forsake the trusty back-tick for one of the more complex methods?
Edit 1.
Big thanks to Avdi Grimm for his posts describing example usage of each method: #1 (& gist); #2 (& gist); #3.
They are fantastic resources to answer How, but are not explicitly composed to answer when each should be used or Why, and as such IMHO are not complete answers to this question.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…