Question about run bash scripts on Django-Python

30 views
Skip to first unread message

David Pineda

unread,
Apr 20, 2015, 10:32:18 AM4/20/15
to django...@googlegroups.com
Hello
I'm a begginner in django and i need to work with a form (send a file) and when the file it's ok run a bash scripts to process that.

I investigate and the common recomendation si use 'subprocess'  an 'sys'
So, i can set the path with de bash app, but the system only recognize the 'echo' command but the another like grep, awk or sed they say 'command not found'. eg:

"home/david/Documents/WEB_PROJ/gestion_docs/procesa_fl/procesa_sse/extrac_data_oficial.sh: line 70: xlsx2csv: command not found
/home/david/Documents/WEB_PROJ/gestion_docs/procesa_fl/procesa_sse/extrac_data_oficial.sh: line 71: xlsx2csv: command not found
/home/david/Documents/WEB_PROJ/gestion_docs/procesa_fl/procesa_sse/extrac_data_oficial.sh: line 72: sed: command not found
/home/david/Documents/WEB_PROJ/gestion_docs/procesa_fl/procesa_sse/extrac_data_oficial.sh: line 73: sed: command not found
/home/david/Documents/WEB_PROJ/gestion_docs/procesa_fl/procesa_sse/extrac_data_oficial.sh: line 74: sed: command not found
/home/david/Documents/WEB_PROJ/gestion_docs/procesa_fl/procesa_sse/extrac_data_oficial.sh: line 77: awk: command not found
/home/david/Documents/WEB_PROJ/gestion_docs/procesa_fl/procesa_sse/extrac_data_oficial.sh: line 77: sed: command not found
/home/david/Documents/WEB_PROJ/gestion_docs/procesa_fl/procesa_sse/extrac_data_oficial.sh: line 79: sed: command not found"

So,  i think the bin path it loose when i run from django, and in this point i'm confused.

How to solve it?

Thanks, very thanks!
--
David A. Pineda Osorio
Ingeniero Civil Electricista
Universidad de Chile





Larry Martell

unread,
Apr 20, 2015, 10:38:38 AM4/20/15
to django...@googlegroups.com
You could specify the full path to the commands in your script, e.g.:
/usr/bin/sed, or where every they are on your system.
Reply all
Reply to author
Forward
0 new messages