Hi I have a bash script:
#!/bin/bash
declare -a list1
declare -a list2
list1=("Hello" "there" "honey")
list2=("More" "strings" "here")
declare -a joined
joined=($(./pytest.py ${list1[@]} ${list2[@]}))
echo ${joined[@]}
Following is the python code pytest.py:
#!/usr/bin/python
import sys
for i in sys.argv:
print "hi"
The error I get is this:
./pybash.sh: line 11: ./pytest.py: Permission denied
I have used the following to set the permission of the shell script:
chmod +x pybash.sh
It still gives me the same error. What am I doing wrong?
python ./pytest.pyinstead of simplypytest.py#!/usr/bin/env pythonso that the shell knows what to execute the script with.chmod +x pytest.pyand add the shebang @dwerner mentions.