Skip to main content

Command Line

Start interactive terminal sessions or execute one-off commands

Connect | interactive sessions

Start an interactive bash session

$ hoop connect my-bash

connection: my-bash | session: e348532d-13f5-4984-8210-1890f1dd4217
root@f4584548f57c:/#

Exec | one off commands

Execute ad-hoc commands to a bash connection

$ hoop exec my-bash -i 'env'
PWD=/
SHLVL=1
PATH=/app:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
_=/usr/bin/env

Input source can come from stdin

hoop exec my-bash <<EOF
ls -l
EOF

Input source can be piped

echo 'ls -l' | hoop exec my-bash

Command arguments can be passed down to connections

hoop exec bash -- -c "ls -l"
info

The -- in a shell command signals the end of options and disables further option processing. In the example above the -c will be used as argument to /bin/bash. The example above is analougous to /bin/bash -c "ls -l".