Open MaxGyver83 opened 9 months ago
Use these macros to run commands in a shell (sh). This allows using shell variables, cd and other shell builtins.
sh
cd
(import sh) (sh/sh cd /tmp && git clone https://github.com/andrewchambers/janet-sh) (sh/sh< if [ "${USER}" = ,(os/getenv "USER") ]; then echo "it's \"me\""; else echo "not me"; fi)
(sh/sh< echo 'test')
(sh/sh< echo hello\ world)
(sh/sh< echo "hello world")
(sh/sh< echo \$PWD)
(sh/sh< echo `\$PWD`)
collect-proc-specs-subshell
collect-proc-specs
sh?
sh<_
bash
bash<
bash?
bash<_
This addresses #21 and #22.
Use these macros to run commands in a shell (
sh
). This allows using shell variables,cd
and other shell builtins.Examples:
These things don't work:
(sh/sh< echo 'test')
(text in single quotes) → Use double quotes or no quotes at all.(sh/sh< echo hello\ world)
(escaping spaces) → Write(sh/sh< echo "hello world")
instead.(sh/sh< echo \$PWD)
(escaping dollar signs) → Use(sh/sh< echo `\$PWD`)
instead.To be discussed
collect-proc-specs-subshell
is very similar (and based on)collect-proc-specs
. Potential code duplication!?sh?
,sh<_
,bash
,bash<
,bash?
,bash<_
!?This addresses #21 and #22.