summaryrefslogtreecommitdiffhomepage
path: root/shutit.html.markdown
diff options
context:
space:
mode:
Diffstat (limited to 'shutit.html.markdown')
-rw-r--r--shutit.html.markdown22
1 files changed, 12 insertions, 10 deletions
diff --git a/shutit.html.markdown b/shutit.html.markdown
index 03c5ea13..d16290b3 100644
--- a/shutit.html.markdown
+++ b/shutit.html.markdown
@@ -29,14 +29,14 @@ session.send('echo Hello World', echo=True)
Running this with:
-```shell
+```bash
python example.py
```
outputs:
-```shell
-python example.py
+```bash
+$ python example.py
echo "Hello World"
echo "Hello World"
Hello World
@@ -67,6 +67,7 @@ which will log you into your server (if you replace with your details) and
output the hostname.
```
+$ python example.py
hostname
hostname
example.com
@@ -87,6 +88,7 @@ session.logout()
which forces you to input the password:
```
+$ python example.py
Input Secret:
hostname
hostname
@@ -122,7 +124,7 @@ session2.logout()
would output:
-```shell
+```bash
$ python example.py
Password for server1
Input Secret:
@@ -162,7 +164,7 @@ session1.logout()
session2.logout()
```
-Here you use the 'send_and_get_output' method to retrieve the output of the
+Here you use the 'send\_and\_get\_output' method to retrieve the output of the
capacity command (df).
There are much more elegant ways to do the above (eg have a dictionary of the
@@ -187,10 +189,10 @@ session.logout()
Note the 'expect' argument. You only need to give a subset of telnet's
prompt to match and continue.
-Note also the 'check_exit' argument in the above, which is new. We'll come back
+Note also the 'check\_exit' argument in the above, which is new. We'll come back
to that. The output of the above is:
-```shell
+```bash
$ python example.py
telnet
telnet> open google.com 80
@@ -217,8 +219,8 @@ here
Connection closed by foreign host.
```
-Now back to 'check_exit=False'. Since the telnet command returns a failure exit
-code (1) and we don't want the script to fail, you set 'check_exit=False' to
+Now back to 'check\_exit=False'. Since the telnet command returns a failure exit
+code (1) and we don't want the script to fail, you set 'check\_exit=False' to
let ShutIt know you don't care about the exit code.
If you didn't pass that argument in, ShutIt gives you an interactive terminal
@@ -248,7 +250,7 @@ session.send('echo "Did you enjoy your pause point?"', echo=True)
with output like this:
-```shell
+```bash
$ python example.py
Have a look around!