1

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.

George
  • 6,927
  • 4
  • 34
  • 67
  • 1
    I 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
  • 1
    and run @luqui 's command via the `turtle` command `exec` or `shell`. – ja. May 17 '17 at 03:22

1 Answers1

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