0

I have two shell scripts, script5.sh, and script4.sh

script5.sh looks like this:

#!bin/bash

FILES=$1/*\txt

for f in $FILES
do

qsub -cwd /path/to/script4.sh $f

done

For script5.sh I pass in a directory /path/to/DIRECTORY_A/where/I/want/certain/files/to/analyze, and that's the $1 in $FILES.

Then in script4.sh I have a bunch of commands that analyze the files from the certain directory that I passed into script5.sh.

IT throws this error when I try to qsub it.

error reason    1:          08/06/2014 10:41:16 [35391:30125]: execvp(/path/to/job_scripts/7858774_job_id, "/path/to/7858774_job_id" "/DIRECTORY_A/the_file_I_want") failed: No such file or directory

I KNOW there is a file DIRECTORY_A/the_file_I_want, but I don't know why it's throwing this error.

I have no idea why it's doing this.

Does anyone have any ideas?

Etan Reisner
  • 77,877
  • 8
  • 106
  • 148
user3799576
  • 183
  • 1
  • 2
  • 10
  • Is `/path/to/job_scripts/7858774_job_id` `script4.sh`? If not what is `script4.sh` doing? – Etan Reisner Aug 06 '14 at 18:05
  • I don't think so. Script4.sh just takes the files passed in from script5, and analyzes them. I do admit that within script4, I'm also invoking other scripts, but it doesn't seem like that's the error. It says DIRECTORY_A/the_file_I_want, does not exist, but it totally exists. This is the file, that I script4, ideally analyzes. I think that qsub itself is having a hard time accessing that directory, but I don't know how to fix that. – user3799576 Aug 06 '14 at 19:07
  • That error lists two paths and does not indicate which is problematic. I think it more likely to be the former as it appears to be `execvp` which is throwing the error. What is that first path? Does it exist? How is it related to `script4.sh` or `/DIRECTORY_A/...`? – Etan Reisner Aug 06 '14 at 19:15
  • This is the entire error: error reason 1: 08/06/2014 12:17:02 [35391:7935]: execvp(/srv/gs1/software/oge2011.11p1/scg3-oge-new/spool/scg1-2-16/job_scripts/7858945, "/srv/gs1/software/oge2011.11p1/scg3-oge-new/spool/scg1-2-16/job_scripts/7858945" "/home/directory/new/file") failed: No such file or directory – user3799576 Aug 06 '14 at 19:19
  • And does '/srv/gs1/software/oge2011.11p1/scg3-oge-new/spool/scg1-2-16/job_scripts/7858945‌' exist? Is that one of the things that `script4.sh` is running? – Etan Reisner Aug 06 '14 at 19:42
  • So maybe this might help: – user3799576 Aug 06 '14 at 19:46
  • I would first test weather "qsub -cwd /path/to/script4.sh $f" works without the for loop, by setting $f to a single file that resides in the directory you want to use as input. Does that work? Does that work on a execution node (if you have ssh access)? – Vince Aug 11 '14 at 18:05

0 Answers0