JanetDocsI'm feeling luckyGithub sign in

os/shell



    cfunction

    (os/shell str)
    
    Pass a command string str directly to the system shell.


2 examplesSign in to add an example
Loading...
(os/shell "uptime > /tmp/uptime.txt")  # => 0
(slurp "/tmp/uptime.txt")
# => @"22:33  up 5 days,  9:34, 15 users, load averages: 1.93 1.74 1.59\n"
(os/rm "/tmp/uptime.txt")  # => nil
cellularmitosis
(os/shell "uptime")  # => 0
# printed to the console:
22:30  up 5 days,  9:31, 15 users, load averages: 1.48 1.50 1.49
cellularmitosis