Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,18 @@
|
|||
string = `ls`
|
||||
# runs command and returns its STDOUT as a string
|
||||
string = %x{ls}
|
||||
# ditto, alternative syntax
|
||||
|
||||
system "ls"
|
||||
# runs command and returns its exit status; its STDOUT gets output to our STDOUT
|
||||
|
||||
print `ls`
|
||||
#The same, but with back quotes
|
||||
|
||||
exec "ls"
|
||||
# replace current process with another
|
||||
|
||||
# call system command and read output asynchronously
|
||||
io = IO.popen('ls')
|
||||
# ... later
|
||||
io.each {|line| puts line}
|
||||
Loading…
Add table
Add a link
Reference in a new issue