mirror of
https://github.com/hymkor/lispect.git
synced 2026-09-04 08:07:23 -04:00
README: wrote about (wait PID)
This commit is contained in:
@@ -17,14 +17,16 @@ Lispect
|
|||||||
(progn
|
(progn
|
||||||
(format (error-output) "Usage: ~A ~A USERNAME@DOMAIN PASSWORD~%" $EXECUTABLE_NAME $PROGRAM_NAME)
|
(format (error-output) "Usage: ~A ~A USERNAME@DOMAIN PASSWORD~%" $EXECUTABLE_NAME $PROGRAM_NAME)
|
||||||
(return-from main nil)))
|
(return-from main nil)))
|
||||||
(defglobal account (car args))
|
|
||||||
(defglobal password (cadr args))
|
(let ((account (car args))
|
||||||
|
(password (cadr args))
|
||||||
|
(sshpid nil))
|
||||||
|
|
||||||
(with-handler
|
(with-handler
|
||||||
(lambda (c)
|
(lambda (c)
|
||||||
(format (error-output) "ssh is not found~%")
|
(format (error-output) "ssh is not found~%")
|
||||||
(return-from main nil))
|
(return-from main nil))
|
||||||
(spawn "ssh" account))
|
(setq sshpid (spawn "ssh" account)))
|
||||||
|
|
||||||
(expect*
|
(expect*
|
||||||
("[fingerprint])?"
|
("[fingerprint])?"
|
||||||
@@ -47,7 +49,10 @@ Lispect
|
|||||||
("$ "))
|
("$ "))
|
||||||
(sendln "echo YOU CAN CALL SOME COMMAND HERE")
|
(sendln "echo YOU CAN CALL SOME COMMAND HERE")
|
||||||
(expect "$ ")
|
(expect "$ ")
|
||||||
(sendln "exit"))
|
(sendln "exit")
|
||||||
|
(wait sshpid)
|
||||||
|
)
|
||||||
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
Install
|
Install
|
||||||
@@ -92,7 +97,9 @@ Parameters enclosed in curly braces {...} are optional and can be omitted.
|
|||||||
- When STRING-n is found on the terminal, COMMANDS-n will be executed
|
- When STRING-n is found on the terminal, COMMANDS-n will be executed
|
||||||
- After SEC seconds have elapsed, COMMANDS-FOR-TIMEOUT will be executed
|
- After SEC seconds have elapsed, COMMANDS-FOR-TIMEOUT will be executed
|
||||||
- `(spawn "COMMANDNAME" "ARG-1" ...)`
|
- `(spawn "COMMANDNAME" "ARG-1" ...)`
|
||||||
- Start the executable file
|
- Start the executable file and it returns Process-ID
|
||||||
|
- `(wait PID)`
|
||||||
|
- Wait the process specified with PID
|
||||||
- `(getenv "NAME")`
|
- `(getenv "NAME")`
|
||||||
- Get the value of the environment variable NAME
|
- Get the value of the environment variable NAME
|
||||||
- `(setenv "NAME" "VALUE")`
|
- `(setenv "NAME" "VALUE")`
|
||||||
|
|||||||
Reference in New Issue
Block a user