Pls. help me recreate shell trick

Daniel Dittmar daniel.dittmar at sap.com
Fri Nov 23 09:30:28 EST 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

Daniel






More information about the Python-list mailing list