I have a bash script which changes the path on my command line, This one,
#!/usr/bin/env python
cd /mnt/vvc/username/deployment/
I have a python script which i wish to run after the path changes to the desired path,
The script,
#!/usr/bin/env python
import subprocess
import os
subprocess.call(['/home/username/new_file.sh'])
for folder in os.listdir(''):
print ('deploy_predict'+' '+folder)
I get this
File "/home/username/new_file.sh", line 2
cd /mnt/vvc/username/deployment/
^
SyntaxError: invalid syntax
Any suggestions on how can i fix this?thanks in advance
/usr/bin/env python(meaning: to run it interpreted as Python). I'd change the line#!/usr/bin/env pythonto#!/bin/bashcdin the spawned process, not in your terminal (not in your parent process) You can maybe understand it as if it opened another terminal? (dunno if that may confuse you more, though)cdin your spawned process, run whatever you need to run and capture its output