I am trying to run a script that's in a directory I have admin rights for, but I am trying to run it from somewhere that is not the directory.. I.E. its a generate load in script that reads all the files in the directory and it gives an output based on those files. But when I try to call it from the terminal it doesn't run unless active directory is the directory where the script is located, is this a permissions issue?
I have tried running it this way:
sh /path/to/file/FILE ./path/to/file/FILE
but when I
cd to directory and run
it runs fine.
Permissions for my account:
drwxrwxr-x 5 edennis edennis 4096 Nov 14 14:35 .
Permissions for script:
-rwxrwxr-x 1 edennis edennis 3644 Nov 14 11:45 zScript
Permissions for files script is accessing:
-rw-rw-r-- 1 edennis edennis 10437424 Oct 15 10:27 document.txt
Contents of script:
#!/bin/bash for file in *.txt do echo "this is my favorite file " "$file" >> output.txt; done