跳轉到內容

Rebol 程式設計/call

來自華夏公益教科書
CALL cmd /input in /output out /error err /wait /console /shell /info /show 

執行 shell 命令以執行另一個程序。

CALL 是一個原生值。

  • cmd -- shell 命令或檔案(型別:字串 檔案 塊)
  • /input -- 將輸入重定向到 stdin
    • in -- (型別:任何字串 埠 檔案 URL 無)
  • /output -- 將 stdout 重定向到 out
    • out -- (型別:字串 埠 檔案 URL 無)
  • /error -- 將 stderr 重定向到 err
    • err -- (型別:字串 埠 檔案 URL 無)
  • /wait -- 執行命令並等待退出
  • /console -- 將 I/O 重定向到控制檯執行命令
  • /shell -- 強制從 shell 執行命令
  • /info -- 返回程序資訊物件
  • /show -- 在控制檯視窗中顯示輸出

原始碼

[編輯 | 編輯原始碼]
call: native[
    "Executes a shell command to run another process." 
    cmd [string! file! block!] "The shell command or file" 
    /input "Redirects in to stdin" 
    in [any-string! port! file! url! none!] 
    /output "Redirects stdout to out" 
    out [string! port! file! url! none!] 
    /error "Redirects stderr to err" 
    err [string! port! file! url! none!] 
    /wait "Runs command and waits for exit" 
    /console "Runs command with I/O redirected to console" 
    /shell "Forces command to be run from shell" 
    /info "Return process information object" 
    /show "Show the output in a console window"
]

華夏公益教科書