CDE
This commit is contained in:
parent
518da4a923
commit
764da6cbbb
6144 changed files with 83610 additions and 11 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