Pls. help me recreate shell trick

Daniel Dittmar daniel.dittmar at
Fri Nov 23 15:30:28 CET 2001

> This was achieved as follows:
> $ECHO rm -r /
> where ECHO was either set to "echo" or nothing according to a command

import os

shellExecute = os.system

def echoOnly (cmd):
    print cmd
    return 0

if testForOptions (...):
    shellExecute = echoOnly


More information about the Python-list mailing list