Oct-20-2018, 11:42 AM
(This post was last modified: Oct-20-2018, 11:42 AM by alinaveed786.)
Thanks, it worked. Additionally, I want to add below statement to the code but its throwing error. Basically, want to remove directory "OPatch.pre6880880" but it's not an empty directory
#!/usr/bin/python from plumbum import local, cmd ORACLE_HOME = local.env['ORACLE_HOME'] path=local.env['PATH'] local.env['PATH'] = "{ohome}/bin:{ohome}/OPatch:{path}".format(ohome=ORACLE_HOME, path=local.env['PATH']) local.cwd.chdir(ORACLE_HOME) cmd.rm -rf('OPatch.pre6880880') cmd.mv('OPatch', 'OPatch.pre6880880') cmd.mkdir('OPatch') osTyp = cmd.uname('-s').strip() if osTyp == 'Linux': cmd.cp("/u03/p6880880_121010_Linux-x86-64.zip", ".") cmd.unzip("p6880880_121010_Linux-x86-64.zip") elif osTyp == 'SunOs': cmd.cp("/u03/p6880880_121010_Linux-x86-64.zip", ".") cmd.unzip("p6880880_121010_Linux-x86-64.zip") else: print("!!\n!! unable to determine OS type !!\n!!")Error
cmd.rm -rf('OPatch.pre6880880') NameError: name 'rf' is not defined