TTY

Steps by steps for a TTY Shell

1. Spawn TTY shell

python -c 'import pty; pty.spawn("/bin/bash")'

2. Background the shell

^Z
stty raw -echo

3. Switch to the shell again

fg

4. On a new terminal (get TERM variable and size of window)

echo $TERM
stty size

5. On the shell

export TERM=xterm-256color
stty rows 67 columns 318

Spawning TTY Shells

Interactive

/bin/sh -i

Perl To Shell

perl —e 'exec "/bin/sh";'
perl: exec "/bin/sh";

Ruby To Shell

ruby: exec "/bin/sh"

Lua To Shell

lua: os.execute('/bin/sh')

AWK To Shell

awk 'BEGIN {system("/bin/sh")}'

Using Find For A Shell

find / -name nameoffile -exec /bin/awk 'BEGIN {system("/bin/sh")}' \;

Using Exec to Launch A Shell

find . -exec /bin/sh \; -quit

Vim To Shell

vim -c ':!/bin/sh'

Vim Escape

vim
:set shell=/bin/sh
:shell

Last updated