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.
shell-script redhat-enterprise-linux
add a comment |
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.
shell-script redhat-enterprise-linux
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 the134
and37
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
add a comment |
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.
shell-script redhat-enterprise-linux
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
shell-script redhat-enterprise-linux
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 the134
and37
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
add a comment |
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 the134
and37
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
add a comment |
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
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 runningmyscript.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) editmyscript.sh
and append-x
to the she-bang line (the#!/bin/sh
on the first line).
– G-Man
Feb 10 '15 at 19:51
add a comment |
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
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 runningmyscript.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) editmyscript.sh
and append-x
to the she-bang line (the#!/bin/sh
on the first line).
– G-Man
Feb 10 '15 at 19:51
add a comment |
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
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 runningmyscript.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) editmyscript.sh
and append-x
to the she-bang line (the#!/bin/sh
on the first line).
– G-Man
Feb 10 '15 at 19:51
add a comment |
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
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
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 runningmyscript.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) editmyscript.sh
and append-x
to the she-bang line (the#!/bin/sh
on the first line).
– G-Man
Feb 10 '15 at 19:51
add a comment |
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 runningmyscript.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) editmyscript.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
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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 the134
and37
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