-
Notifications
You must be signed in to change notification settings - Fork 4
2. Builtin Wrappers
lukemartinlogan edited this page May 3, 2023
·
3 revisions
We have various wrappers to support much shell functionality. At this time, these have been built and tested for Linux. These codes inherit from the "Exec" class shown in section 1. This way, they can be executed locally or in parallel.
We provide various wrappers for filesystem commands.
from jarvis_util.shell.filesystem import Mkdir
from jarvis_util.shell.filesystem import Rm
# Creates two directories "path1" and "path2"
Mkdir(['path1', 'path2'])
# Creates a single directory path3
Mkdir('path3')
# Remove two directories (including subdirectories + files)
Rm(['path1', 'path2'])
# Remove a single directory
Rm('path3')
We provide a wrapper for pkill, which can kill processes in parallel
from jarvis_util.shell.process import Kill
# Kill all processes matching pattern
Kill('hermes')