I am trying to call a script using another script located in a different directory but some errors(related to the location of the file) appear. To ilustrate my problem, I will show an example.
Imagine that I have a folder called 001, and inside the folder has another 3 subfolders called A , B and C. Furthermore, inside the folder 001 there are a script called script
.
In each subfolder A, B and C I has the files lista, listb and listc respectively
When I execute the script
, the output are printed and every is OK.
But I am interested to call this script using the motherscript
, but I get the error.
cat: A/lista: No such file or directory
cat: B/listb: No such file or directory
cat: C/listc: No such file or directory
Ilustration of directories
folder
|_ motherscript
|_ 001
|_ A
| |_lista
|_ B
| |_listb
|_ C
| |_listc
|_ script
script
cat A/lista B/listb C/listc > output
motherscript
./001/script
lista
1
2
3
listb
4
5
6
listc
7
8
9
output
1
2
3
4
5
6
7
8
9
script
as./001/script
and do not have anything in there that changes directory your path to, say,lista
is001/A/lista
not justA/lista