Crystal lang : execute shell command
1 min readJan 2, 2018
To execute shell command with Crystal use the system function.
puts "START"fork do
system "echo 'HELLO'"
endputs "END"# This program prints the following :
# > START
# > END
# > HELLO
Fork creates a new system thread to execute the command to deal with the fact that system is a blocking statement.
The system command in crystal works a lot like the system command in ruby.
Buy me a coffee
If you find this article useful consider buying me a coffee :) This helps me publish more useful content!