Using turtle, how does one run a custom bash command found in /a/path/to/a/file.sh
? It would be the equivalent of source /a/path/to/a/file.sh
and then calling custom_bash_function
.
Asked
Active
Viewed 163 times
1

George
- 6,927
- 4
- 34
- 67
-
1I don't know turtle, but I'd just go through bash. `bash -c 'source /a/path/to/a/file.sh; custom_bash_function'` – luqui May 17 '17 at 01:36
-
1and run @luqui 's command via the `turtle` command `exec` or `shell`. – ja. May 17 '17 at 03:22
1 Answers
0
{-# LANGUAGE OverloadedStrings #-}
import Turtle.Prelude (proc, procs, shell, shells)
main :: IO ()
main = do
procs "ls" [] mempty --(without ExitCode)
procs "ls" ["-la"] mempty --(without ExitCode)
proc "pwd" [] mempty --(with ExitCode)
proc "ls" ["-la"] mempty --(with ExitCode)
shells "ls -la" mempty --(without ExitCode)
shell "pwd" mempty --(with ExitCode)
shell "ls -la" mempty --(with ExitCode)

Chris
- 56
- 4
-
This doesn't seem to answer the question at all. Did you post it by mistake? – leftaroundabout Jul 05 '22 at 08:18