Skip to content
Advertisement

No such file or directory error in linux

Recently I have installed a program called “paradigm”. In the program path (/home/hora/Paradigm/) there is a directory “testdata” (/home/hora/Paradigm/testdata) which includes a shell script that runs an example test of the application.The first time I installed the program I was able to run the shell script(runtests.sh) but now that I try to run it I get the error of ” No such file or directory”, although the files which is mentioned by the error are there. I am sure the problem is due to lack of my knowledge to linux and your help will be appreciated. To show the situation:

hora@serv:~/Paradigm/testdata$ ./runtests.sh 
Testing node splitting [1/2], should take seconds
diff: needs_split_1.out: No such file or directory
./runtests.sh: line 6: ../pathwaytab2daifg: No such file or directory

But if I list the content of directory the mentioned files are there:

hora@serv:~/Paradigm/testdata$ ls 
complex_family_pathway.tab      needs_split_1.cfg          needs_split_2.out          runtests.sh                    small_disconnected_pathway.tab
complex_family_pathway.tab.out  needs_split_1.out          needs_split_2.pathway.tab

And then:

 hora@serv:~/Paradigm$ ls 
 common.h           configuration.o    
 evidencesource.o  helperScripts  makefile         
 pathwaytab2daifg.cpp  pathwaytab.h      test1 configuration.cpp 
 evidencesource.cpp  externVars.cpp    main.cpp       paradigm         
 pathwaytab2daifg.o    pathwaytab.o      testdata configuration.h   
 evidencesource.h    externVars.o      main.o         pathwaytab2daifg 
 pathwaytab.cpp        README.mediawiki

This is the script content(the problematic part):

#!/bin/bash

set -o pipefail
cd 
echo Testing node splitting [1/2], should take seconds
../pathwaytab2daifg needs_split_1.pathway.tab needs_split_1.cfg  
    | diff needs_split_1.out - || exit 1

Advertisement

Answer

I believe the authors of this script want you to set HOME to ~/Paradigm, or they expect you to install directly in your HOME directory (~) rather than in ~/Paradigm. Either way, this is an error on their part. A simple fix may be to move the installation to ~, or try:

env HOME=$(pwd) ./runtests.sh

(Note that the env is not necessary unless you are running a csh family shell such as csh or tcsh). Setting HOME changes the behavior of cd when called with no arguments and makes the value of HOME the target directory.

Advertisement