ifâ¦elseâ¦if statement (command not found error)
Clash Royale CLAN TAG#URR8PPP
up vote
-5
down vote
favorite
Can someone tell me what is wrong with this loop?
The error that I have is on the line 107 (first line of the loop). It says:
[V2016057174800: command not found.
I am trying to associate two the same filename from two different documents (if that makes sense).
bash shell
add a comment |Â
up vote
-5
down vote
favorite
Can someone tell me what is wrong with this loop?
The error that I have is on the line 107 (first line of the loop). It says:
[V2016057174800: command not found.
I am trying to associate two the same filename from two different documents (if that makes sense).
bash shell
4
[
is a command itself, and needs a space after it (you'll also need a space before the]
). Please paste in text instead of using a screenshot, too.
â drewbenn
Jul 12 '17 at 19:44
add a comment |Â
up vote
-5
down vote
favorite
up vote
-5
down vote
favorite
Can someone tell me what is wrong with this loop?
The error that I have is on the line 107 (first line of the loop). It says:
[V2016057174800: command not found.
I am trying to associate two the same filename from two different documents (if that makes sense).
bash shell
Can someone tell me what is wrong with this loop?
The error that I have is on the line 107 (first line of the loop). It says:
[V2016057174800: command not found.
I am trying to associate two the same filename from two different documents (if that makes sense).
bash shell
bash shell
edited Jul 12 '17 at 19:53
Stephen Rauch
3,258101328
3,258101328
asked Jul 12 '17 at 19:29
dia.duran
13
13
4
[
is a command itself, and needs a space after it (you'll also need a space before the]
). Please paste in text instead of using a screenshot, too.
â drewbenn
Jul 12 '17 at 19:44
add a comment |Â
4
[
is a command itself, and needs a space after it (you'll also need a space before the]
). Please paste in text instead of using a screenshot, too.
â drewbenn
Jul 12 '17 at 19:44
4
4
[
is a command itself, and needs a space after it (you'll also need a space before the ]
). Please paste in text instead of using a screenshot, too.â drewbenn
Jul 12 '17 at 19:44
[
is a command itself, and needs a space after it (you'll also need a space before the ]
). Please paste in text instead of using a screenshot, too.â drewbenn
Jul 12 '17 at 19:44
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
4
down vote
Your formatting is very strange!
You probably want to fix that first to make this code somewhat readable!
That said, your problem is the lack of spaces around [
and ]
.
These characters [
]
are actually just shorthand for the command test
.
You should change the first line to read as follows:
in bash
if [[ "$L1Aname" == "$filename" ]]; then
or
in POSIX shells
if [ "$L1Aname" = "$filename" ]; then
inside both of which examples, each character maters:
For example spaces: there need to be spaces around [
and ]
.
Plus notice the subtle difference between bash
and POSIX in the double / single =
.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
Your formatting is very strange!
You probably want to fix that first to make this code somewhat readable!
That said, your problem is the lack of spaces around [
and ]
.
These characters [
]
are actually just shorthand for the command test
.
You should change the first line to read as follows:
in bash
if [[ "$L1Aname" == "$filename" ]]; then
or
in POSIX shells
if [ "$L1Aname" = "$filename" ]; then
inside both of which examples, each character maters:
For example spaces: there need to be spaces around [
and ]
.
Plus notice the subtle difference between bash
and POSIX in the double / single =
.
add a comment |Â
up vote
4
down vote
Your formatting is very strange!
You probably want to fix that first to make this code somewhat readable!
That said, your problem is the lack of spaces around [
and ]
.
These characters [
]
are actually just shorthand for the command test
.
You should change the first line to read as follows:
in bash
if [[ "$L1Aname" == "$filename" ]]; then
or
in POSIX shells
if [ "$L1Aname" = "$filename" ]; then
inside both of which examples, each character maters:
For example spaces: there need to be spaces around [
and ]
.
Plus notice the subtle difference between bash
and POSIX in the double / single =
.
add a comment |Â
up vote
4
down vote
up vote
4
down vote
Your formatting is very strange!
You probably want to fix that first to make this code somewhat readable!
That said, your problem is the lack of spaces around [
and ]
.
These characters [
]
are actually just shorthand for the command test
.
You should change the first line to read as follows:
in bash
if [[ "$L1Aname" == "$filename" ]]; then
or
in POSIX shells
if [ "$L1Aname" = "$filename" ]; then
inside both of which examples, each character maters:
For example spaces: there need to be spaces around [
and ]
.
Plus notice the subtle difference between bash
and POSIX in the double / single =
.
Your formatting is very strange!
You probably want to fix that first to make this code somewhat readable!
That said, your problem is the lack of spaces around [
and ]
.
These characters [
]
are actually just shorthand for the command test
.
You should change the first line to read as follows:
in bash
if [[ "$L1Aname" == "$filename" ]]; then
or
in POSIX shells
if [ "$L1Aname" = "$filename" ]; then
inside both of which examples, each character maters:
For example spaces: there need to be spaces around [
and ]
.
Plus notice the subtle difference between bash
and POSIX in the double / single =
.
edited Oct 1 at 13:49
Vlastimil
6,8871149124
6,8871149124
answered Jul 12 '17 at 19:50
rlf
403111
403111
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f378052%2fif-else-if-statement-command-not-found-error%23new-answer', 'question_page');
);
Post as a guest
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
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
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
4
[
is a command itself, and needs a space after it (you'll also need a space before the]
). Please paste in text instead of using a screenshot, too.â drewbenn
Jul 12 '17 at 19:44