Last active
September 30, 2015 12:33
-
-
Save pathcl/ecb1b7fd1e06e366007e to your computer and use it in GitHub Desktop.
attemp to create a shell in python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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