(import sh)
# raise an error on failure.
(sh/$ ["touch" "foo.txt"])
# raise an error on failure, return command output.
(sh/$$ ["echo" "hello world!"])
@"hello world!\n"
# return true or false depending on process success.
(when (sh/$? ["true"])
(print "cool!"))
# shell helpers
(sh/shell-quote ["hello" "there ' \""])
"'hello' 'there '\\'' \"'"
(sh/pipeline [["ls"] ["sort" "-u"]])
@["/bin/sh" "-c" "'ls' | 'sort' '-u'"] # pass this to a run function.
forked from andrewchambers/janet-sh
-
Notifications
You must be signed in to change notification settings - Fork 0
pepe/janet-sh
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
A mini library for janet, inspired by janetsh
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published