python implement of *nix shell utility