0

I have to execute this following command

exec /dir6/dir5/dir4/openssl enc -d -aes-256-cbc -a -in /home/dir2/dir3/XXX.enc -pass pass:password

from my python Script. I have used

subprocess.call(["exec"," /dir6/dir5/dir4/openssl","enc","-d","-aes-256-cbc","-a","-in","/home/dir2/dir3/XXX.enc","-pass", "pass:password"])

but it doesn't work.

Can anyone help me on this. Thanks in advance.

1
  • It gives me the below mentioned error as before: File "/usr/lib64/python2.6/subprocess.py", line 478, in call p = Popen(*popenargs, **kwargs) File "/usr/lib64/python2.6/subprocess.py", line 642, in __init__ errread, errwrite) File "/usr/lib64/python2.6/subprocess.py", line 1234, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory Commented Feb 25, 2015 at 15:11

1 Answer 1

1

you don't need "exec" here, and there is an unneeded space before /dir6 :

subprocess.call(['/dir6/dir5/dir4/openssl', 'enc', '-d', '-aes-256-cbc', '-a', '-in', '/home/dir2/dir3/XXX.enc' ,'-pass' , 'pass:password'])

I assumed that your command works, but I could not find the -pass option in the openssl manual.

Sign up to request clarification or add additional context in comments.

6 Comments

Thanks for the answer JBzh. Please see the error i just mentioned, hope u can help me more on this now.
did you removed the space in " /dir6/dir5/dir4/openssl" ? does the file /dir6/dir5/dir4/openssl exists ?
Yes i have tried after removing the space too. & yes the file exists as that command is executing in a tcl script already.
what is the output of this command if your execute it from your shell directly ? Not inside your python script and not from your TCL script, directly from the shell : /dir6/dir5/dir4/openssl . You removed 'exec' too, as stated in my answer ?
/dir6/dir5/dir4/openssl or exec /dir6/dir5/dir4/openssl Error: Command not found cd /dir6/dir5/dir4/openssl Error: No such file or directory
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.