Я установил guile
и смог заставить его выполнять код четырьмя способами:
$ guile <<< "(+ 1 1)"
GNU Guile 2.0.9
Copyright (C) 1995-2013 Free Software Foundation, Inc.
Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.
Enter `,help' for help.
$1 = 2
$
$ echo "(+ 1 1)" | guile
GNU Guile 2.0.9
Copyright (C) 1995-2013 Free Software Foundation, Inc.
Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.
Enter `,help' for help.
$1 = 2
scheme@(guile-user)>
$
$ echo "(+ 1 1)" > guile.script
$ guile < guile.script
GNU Guile 2.0.9
Copyright (C) 1995-2013 Free Software Foundation, Inc.
Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.
Enter `,help' for help.
$1 = 2
$
Спасибо GAD3R за этот:
$ guile -c "(display (+ 1 1)) (newline)"
2
$
Во всех случаях я возвращаюсь к исходному приглашению оболочки (на что указывают голые строки $
).
Попробуйте это для того, чтобы убедиться, что вы убиваете
правильный PID:
./command1 &
childpid=$!
trap "kill -TERM ${childpid}" EXIT
GNU Parallel учитывает Ctrl -c. Так что можешь бежать:
parallel :::./command1 /path/to/bash2