Skip to content

Instantly share code, notes, and snippets.

@pathcl
Last active September 30, 2015 12:33
Show Gist options
  • Select an option

  • Save pathcl/ecb1b7fd1e06e366007e to your computer and use it in GitHub Desktop.

Select an option

Save pathcl/ecb1b7fd1e06e366007e to your computer and use it in GitHub Desktop.
attemp to create a shell in python
#!/usr/bin/env python3
import os
while True:
line = input('> ')
line_array = line.split()
pid = os.fork()
if not pid:
os.execvp(line_array[0], line_array)
os.wait()[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment