cannot open `' for reading: No such file or directory











up vote
0
down vote

favorite












I am trying to run .sh file on RH6 and getting this error...



cannot open '' for reading: No such file or directory


The script I am running is internally referencing other scripts, located in same directory. I can see them using ls -la.



Note: This script is working perfectly fine on RH4. I got new fresh RH6 machine on which I am trying to run my scripts.



My abc.sh script as mentioned below



. fox_comm_server_details.sh
. fox_comm_topic_names.sh
. fox_comm_sh_tools.sh


refers to other script (.sh) files.



When I run my abc.sh (with ./abc.sh) it says



fox_comm_server_details.sh: cannot open [No such file or directory]


I confirmed the required scripts are present in directory and I have permissions on them.
If I update the abc.sh as below...



. ./fox_comm_server_details.sh
. ./fox_comm_topic_names.sh
. ./fox_comm_sh_tools.sh


This time it is not complaining about missing files but some different error as mentioned below...






read_fox_comm_servers_list[134]: read_fox_comm_servers_list_defaults[37]: local: not found [No such file or directory]




read_fox_comm_servers_list and read_fox_comm_servers_list_defaults are functions that are defined in fox_comm_sh_tools.sh as follows...



function read_fox_comm_servers_list
{
read_fox_comm_servers_list_defaults
read_fox_comm_servers_list_overrides
}

function read_fox_comm_servers_list_defaults
{
local tempfile=/tmp/read_fox_comm_servers_list_defaults.$$
}


and getting above mentioned error.










share|improve this question




















  • 3




    Please edit your question to include the script you are trying to run.
    – DavidPostill
    Feb 9 '15 at 12:34










  • And provide the result of ls -l command. Also did you arr read permission to the script? They can't work w/o this permission
    – Romeo Ninov
    Feb 9 '15 at 12:50










  • What is line 1 of your script. If it's #!/bin/sh, do you know what /bin/sh is on your system (e.g., is it bash or dash)? ... I guess that the 134 and 37 in the error message(s) are line numbers. You're probably right not to dump the entire 135+ line script on us, but have you tried deleting lines from (a working, debug copy of) the script until the error goes away? Try that -- the last thing you deleted will probably be a big clue to the problem.
    – G-Man
    Feb 10 '15 at 19:49















up vote
0
down vote

favorite












I am trying to run .sh file on RH6 and getting this error...



cannot open '' for reading: No such file or directory


The script I am running is internally referencing other scripts, located in same directory. I can see them using ls -la.



Note: This script is working perfectly fine on RH4. I got new fresh RH6 machine on which I am trying to run my scripts.



My abc.sh script as mentioned below



. fox_comm_server_details.sh
. fox_comm_topic_names.sh
. fox_comm_sh_tools.sh


refers to other script (.sh) files.



When I run my abc.sh (with ./abc.sh) it says



fox_comm_server_details.sh: cannot open [No such file or directory]


I confirmed the required scripts are present in directory and I have permissions on them.
If I update the abc.sh as below...



. ./fox_comm_server_details.sh
. ./fox_comm_topic_names.sh
. ./fox_comm_sh_tools.sh


This time it is not complaining about missing files but some different error as mentioned below...






read_fox_comm_servers_list[134]: read_fox_comm_servers_list_defaults[37]: local: not found [No such file or directory]




read_fox_comm_servers_list and read_fox_comm_servers_list_defaults are functions that are defined in fox_comm_sh_tools.sh as follows...



function read_fox_comm_servers_list
{
read_fox_comm_servers_list_defaults
read_fox_comm_servers_list_overrides
}

function read_fox_comm_servers_list_defaults
{
local tempfile=/tmp/read_fox_comm_servers_list_defaults.$$
}


and getting above mentioned error.










share|improve this question




















  • 3




    Please edit your question to include the script you are trying to run.
    – DavidPostill
    Feb 9 '15 at 12:34










  • And provide the result of ls -l command. Also did you arr read permission to the script? They can't work w/o this permission
    – Romeo Ninov
    Feb 9 '15 at 12:50










  • What is line 1 of your script. If it's #!/bin/sh, do you know what /bin/sh is on your system (e.g., is it bash or dash)? ... I guess that the 134 and 37 in the error message(s) are line numbers. You're probably right not to dump the entire 135+ line script on us, but have you tried deleting lines from (a working, debug copy of) the script until the error goes away? Try that -- the last thing you deleted will probably be a big clue to the problem.
    – G-Man
    Feb 10 '15 at 19:49













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I am trying to run .sh file on RH6 and getting this error...



cannot open '' for reading: No such file or directory


The script I am running is internally referencing other scripts, located in same directory. I can see them using ls -la.



Note: This script is working perfectly fine on RH4. I got new fresh RH6 machine on which I am trying to run my scripts.



My abc.sh script as mentioned below



. fox_comm_server_details.sh
. fox_comm_topic_names.sh
. fox_comm_sh_tools.sh


refers to other script (.sh) files.



When I run my abc.sh (with ./abc.sh) it says



fox_comm_server_details.sh: cannot open [No such file or directory]


I confirmed the required scripts are present in directory and I have permissions on them.
If I update the abc.sh as below...



. ./fox_comm_server_details.sh
. ./fox_comm_topic_names.sh
. ./fox_comm_sh_tools.sh


This time it is not complaining about missing files but some different error as mentioned below...






read_fox_comm_servers_list[134]: read_fox_comm_servers_list_defaults[37]: local: not found [No such file or directory]




read_fox_comm_servers_list and read_fox_comm_servers_list_defaults are functions that are defined in fox_comm_sh_tools.sh as follows...



function read_fox_comm_servers_list
{
read_fox_comm_servers_list_defaults
read_fox_comm_servers_list_overrides
}

function read_fox_comm_servers_list_defaults
{
local tempfile=/tmp/read_fox_comm_servers_list_defaults.$$
}


and getting above mentioned error.










share|improve this question















I am trying to run .sh file on RH6 and getting this error...



cannot open '' for reading: No such file or directory


The script I am running is internally referencing other scripts, located in same directory. I can see them using ls -la.



Note: This script is working perfectly fine on RH4. I got new fresh RH6 machine on which I am trying to run my scripts.



My abc.sh script as mentioned below



. fox_comm_server_details.sh
. fox_comm_topic_names.sh
. fox_comm_sh_tools.sh


refers to other script (.sh) files.



When I run my abc.sh (with ./abc.sh) it says



fox_comm_server_details.sh: cannot open [No such file or directory]


I confirmed the required scripts are present in directory and I have permissions on them.
If I update the abc.sh as below...



. ./fox_comm_server_details.sh
. ./fox_comm_topic_names.sh
. ./fox_comm_sh_tools.sh


This time it is not complaining about missing files but some different error as mentioned below...






read_fox_comm_servers_list[134]: read_fox_comm_servers_list_defaults[37]: local: not found [No such file or directory]




read_fox_comm_servers_list and read_fox_comm_servers_list_defaults are functions that are defined in fox_comm_sh_tools.sh as follows...



function read_fox_comm_servers_list
{
read_fox_comm_servers_list_defaults
read_fox_comm_servers_list_overrides
}

function read_fox_comm_servers_list_defaults
{
local tempfile=/tmp/read_fox_comm_servers_list_defaults.$$
}


and getting above mentioned error.







shell-script redhat-enterprise-linux






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 18 '16 at 1:23









fixer1234

17.3k144280




17.3k144280










asked Feb 9 '15 at 12:29









user417090

112




112








  • 3




    Please edit your question to include the script you are trying to run.
    – DavidPostill
    Feb 9 '15 at 12:34










  • And provide the result of ls -l command. Also did you arr read permission to the script? They can't work w/o this permission
    – Romeo Ninov
    Feb 9 '15 at 12:50










  • What is line 1 of your script. If it's #!/bin/sh, do you know what /bin/sh is on your system (e.g., is it bash or dash)? ... I guess that the 134 and 37 in the error message(s) are line numbers. You're probably right not to dump the entire 135+ line script on us, but have you tried deleting lines from (a working, debug copy of) the script until the error goes away? Try that -- the last thing you deleted will probably be a big clue to the problem.
    – G-Man
    Feb 10 '15 at 19:49














  • 3




    Please edit your question to include the script you are trying to run.
    – DavidPostill
    Feb 9 '15 at 12:34










  • And provide the result of ls -l command. Also did you arr read permission to the script? They can't work w/o this permission
    – Romeo Ninov
    Feb 9 '15 at 12:50










  • What is line 1 of your script. If it's #!/bin/sh, do you know what /bin/sh is on your system (e.g., is it bash or dash)? ... I guess that the 134 and 37 in the error message(s) are line numbers. You're probably right not to dump the entire 135+ line script on us, but have you tried deleting lines from (a working, debug copy of) the script until the error goes away? Try that -- the last thing you deleted will probably be a big clue to the problem.
    – G-Man
    Feb 10 '15 at 19:49








3




3




Please edit your question to include the script you are trying to run.
– DavidPostill
Feb 9 '15 at 12:34




Please edit your question to include the script you are trying to run.
– DavidPostill
Feb 9 '15 at 12:34












And provide the result of ls -l command. Also did you arr read permission to the script? They can't work w/o this permission
– Romeo Ninov
Feb 9 '15 at 12:50




And provide the result of ls -l command. Also did you arr read permission to the script? They can't work w/o this permission
– Romeo Ninov
Feb 9 '15 at 12:50












What is line 1 of your script. If it's #!/bin/sh, do you know what /bin/sh is on your system (e.g., is it bash or dash)? ... I guess that the 134 and 37 in the error message(s) are line numbers. You're probably right not to dump the entire 135+ line script on us, but have you tried deleting lines from (a working, debug copy of) the script until the error goes away? Try that -- the last thing you deleted will probably be a big clue to the problem.
– G-Man
Feb 10 '15 at 19:49




What is line 1 of your script. If it's #!/bin/sh, do you know what /bin/sh is on your system (e.g., is it bash or dash)? ... I guess that the 134 and 37 in the error message(s) are line numbers. You're probably right not to dump the entire 135+ line script on us, but have you tried deleting lines from (a working, debug copy of) the script until the error goes away? Try that -- the last thing you deleted will probably be a big clue to the problem.
– G-Man
Feb 10 '15 at 19:49










1 Answer
1






active

oldest

votes

















up vote
0
down vote













A shot in the dark:
please edit your question clicking on this link because so it's really difficult to understand.



In general is seems that somewhere in a script (or in a subscript) a variable is not set with a filename.

You can notice from '' without a name inside in your error message




cannot open '' for reading: No such file or directory




You can search where is the error activating the debug in your shell



set -x           # to activate debugging  
./myscript.sh # here your script invocation
set +x # to stop debugging





share|improve this answer



















  • 1




    This won't quite work. Shell options (e.g., xtrace, or -x for short) are not passed from parent to child, so this will only say that the user is running myscript.sh, but not what happens in the script. For that you would need one of the following: (1) set -x; . myscript.sh; set +x (probably not a good idea), (2) (set -x; . myscript.sh) (note the parentheses), (3) sh -x myscript.sh, or (4) edit myscript.sh and append -x to the she-bang line (the #!/bin/sh on the first line).
    – G-Man
    Feb 10 '15 at 19:51











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f875624%2fcannot-open-for-reading-no-such-file-or-directory%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













A shot in the dark:
please edit your question clicking on this link because so it's really difficult to understand.



In general is seems that somewhere in a script (or in a subscript) a variable is not set with a filename.

You can notice from '' without a name inside in your error message




cannot open '' for reading: No such file or directory




You can search where is the error activating the debug in your shell



set -x           # to activate debugging  
./myscript.sh # here your script invocation
set +x # to stop debugging





share|improve this answer



















  • 1




    This won't quite work. Shell options (e.g., xtrace, or -x for short) are not passed from parent to child, so this will only say that the user is running myscript.sh, but not what happens in the script. For that you would need one of the following: (1) set -x; . myscript.sh; set +x (probably not a good idea), (2) (set -x; . myscript.sh) (note the parentheses), (3) sh -x myscript.sh, or (4) edit myscript.sh and append -x to the she-bang line (the #!/bin/sh on the first line).
    – G-Man
    Feb 10 '15 at 19:51















up vote
0
down vote













A shot in the dark:
please edit your question clicking on this link because so it's really difficult to understand.



In general is seems that somewhere in a script (or in a subscript) a variable is not set with a filename.

You can notice from '' without a name inside in your error message




cannot open '' for reading: No such file or directory




You can search where is the error activating the debug in your shell



set -x           # to activate debugging  
./myscript.sh # here your script invocation
set +x # to stop debugging





share|improve this answer



















  • 1




    This won't quite work. Shell options (e.g., xtrace, or -x for short) are not passed from parent to child, so this will only say that the user is running myscript.sh, but not what happens in the script. For that you would need one of the following: (1) set -x; . myscript.sh; set +x (probably not a good idea), (2) (set -x; . myscript.sh) (note the parentheses), (3) sh -x myscript.sh, or (4) edit myscript.sh and append -x to the she-bang line (the #!/bin/sh on the first line).
    – G-Man
    Feb 10 '15 at 19:51













up vote
0
down vote










up vote
0
down vote









A shot in the dark:
please edit your question clicking on this link because so it's really difficult to understand.



In general is seems that somewhere in a script (or in a subscript) a variable is not set with a filename.

You can notice from '' without a name inside in your error message




cannot open '' for reading: No such file or directory




You can search where is the error activating the debug in your shell



set -x           # to activate debugging  
./myscript.sh # here your script invocation
set +x # to stop debugging





share|improve this answer














A shot in the dark:
please edit your question clicking on this link because so it's really difficult to understand.



In general is seems that somewhere in a script (or in a subscript) a variable is not set with a filename.

You can notice from '' without a name inside in your error message




cannot open '' for reading: No such file or directory




You can search where is the error activating the debug in your shell



set -x           # to activate debugging  
./myscript.sh # here your script invocation
set +x # to stop debugging






share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 20 '17 at 10:17









Community

1




1










answered Feb 9 '15 at 14:07









Hastur

13k53266




13k53266








  • 1




    This won't quite work. Shell options (e.g., xtrace, or -x for short) are not passed from parent to child, so this will only say that the user is running myscript.sh, but not what happens in the script. For that you would need one of the following: (1) set -x; . myscript.sh; set +x (probably not a good idea), (2) (set -x; . myscript.sh) (note the parentheses), (3) sh -x myscript.sh, or (4) edit myscript.sh and append -x to the she-bang line (the #!/bin/sh on the first line).
    – G-Man
    Feb 10 '15 at 19:51














  • 1




    This won't quite work. Shell options (e.g., xtrace, or -x for short) are not passed from parent to child, so this will only say that the user is running myscript.sh, but not what happens in the script. For that you would need one of the following: (1) set -x; . myscript.sh; set +x (probably not a good idea), (2) (set -x; . myscript.sh) (note the parentheses), (3) sh -x myscript.sh, or (4) edit myscript.sh and append -x to the she-bang line (the #!/bin/sh on the first line).
    – G-Man
    Feb 10 '15 at 19:51








1




1




This won't quite work. Shell options (e.g., xtrace, or -x for short) are not passed from parent to child, so this will only say that the user is running myscript.sh, but not what happens in the script. For that you would need one of the following: (1) set -x; . myscript.sh; set +x (probably not a good idea), (2) (set -x; . myscript.sh) (note the parentheses), (3) sh -x myscript.sh, or (4) edit myscript.sh and append -x to the she-bang line (the #!/bin/sh on the first line).
– G-Man
Feb 10 '15 at 19:51




This won't quite work. Shell options (e.g., xtrace, or -x for short) are not passed from parent to child, so this will only say that the user is running myscript.sh, but not what happens in the script. For that you would need one of the following: (1) set -x; . myscript.sh; set +x (probably not a good idea), (2) (set -x; . myscript.sh) (note the parentheses), (3) sh -x myscript.sh, or (4) edit myscript.sh and append -x to the she-bang line (the #!/bin/sh on the first line).
– G-Man
Feb 10 '15 at 19:51


















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f875624%2fcannot-open-for-reading-no-such-file-or-directory%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Сан-Квентин

Алькесар

Josef Freinademetz