Crystal: Is there a way to execute system commands?

Created on 28 Apr 2015  路  6Comments  路  Source: crystal-lang/crystal

Like system, exec or the backticks in ruby?

Most helpful comment

For anybody ending up here in 2020, this is the documentation page you want:
https://crystal-lang.org/reference/syntax_and_semantics/literals/command.html

Or the keyword to search for if things get moved around again is: "Command literal"

All 6 comments

Yes, see https://github.com/manastech/crystal/blob/master/src/process/run.cr which defines system, the backtick method and a general interface for both as Process.run.

Thanks. There is no chapter in the documentation, isn't it? I'll write one and open a PR, ok?

I see nothing at http://crystal-lang.org/docs/ too, correct, whether that's the best place to document them I'm not sure.

But there are no inline docs for them yet too, and those are most definitely a welcome contribution!

@ssvb http://crystal-lang.org/api/ is generated from the inline comments in the code (using Markdown)

For anybody ending up here in 2020, this is the documentation page you want:
https://crystal-lang.org/reference/syntax_and_semantics/literals/command.html

Or the keyword to search for if things get moved around again is: "Command literal"

Was this page helpful?
0 / 5 - 0 ratings

Related issues

asterite picture asterite  路  3Comments

oprypin picture oprypin  路  3Comments

pbrusco picture pbrusco  路  3Comments

grosser picture grosser  路  3Comments

lbguilherme picture lbguilherme  路  3Comments