Bash: command not found
I have a script that needs to know the processor architecture. I'm doing this way:
if [["$(uname -m)" = "x86_64"]]; then
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
else
echo "Nossa! Você só pode usar 3,5GB de memória RAM. Que triste :( Vou baixar a versão 32bits pra você tá?"
wget https://dl.google.com/linux/direct/google-chrome-stable_current_i386.rpm
fi
But when I execute the code, I receive:
instala_chrome.sh: line 35: [[x86_64: command not found
Anyone can help me to solve this? Thanks!
command-line bash scripts
add a comment |
I have a script that needs to know the processor architecture. I'm doing this way:
if [["$(uname -m)" = "x86_64"]]; then
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
else
echo "Nossa! Você só pode usar 3,5GB de memória RAM. Que triste :( Vou baixar a versão 32bits pra você tá?"
wget https://dl.google.com/linux/direct/google-chrome-stable_current_i386.rpm
fi
But when I execute the code, I receive:
instala_chrome.sh: line 35: [[x86_64: command not found
Anyone can help me to solve this? Thanks!
command-line bash scripts
add a comment |
I have a script that needs to know the processor architecture. I'm doing this way:
if [["$(uname -m)" = "x86_64"]]; then
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
else
echo "Nossa! Você só pode usar 3,5GB de memória RAM. Que triste :( Vou baixar a versão 32bits pra você tá?"
wget https://dl.google.com/linux/direct/google-chrome-stable_current_i386.rpm
fi
But when I execute the code, I receive:
instala_chrome.sh: line 35: [[x86_64: command not found
Anyone can help me to solve this? Thanks!
command-line bash scripts
I have a script that needs to know the processor architecture. I'm doing this way:
if [["$(uname -m)" = "x86_64"]]; then
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
else
echo "Nossa! Você só pode usar 3,5GB de memória RAM. Que triste :( Vou baixar a versão 32bits pra você tá?"
wget https://dl.google.com/linux/direct/google-chrome-stable_current_i386.rpm
fi
But when I execute the code, I receive:
instala_chrome.sh: line 35: [[x86_64: command not found
Anyone can help me to solve this? Thanks!
command-line bash scripts
command-line bash scripts
edited Aug 31 '12 at 10:38
jokerdino♦
32.5k21118186
32.5k21118186
asked Aug 31 '12 at 10:36
Alexandre TelesAlexandre Teles
1,062812
1,062812
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Better use:
if [[ "$(uname -m)" == "x86_64" ]]; then
Notice the space between [[
and first parameter, two =
signs , and the space between "x86_64"
and ]]
Also, it is not a good idea to include !
inside echo :)
I think that that's the best place to refer to when doing such operations: http://mywiki.wooledge.org/BashPitfalls
This works. Thank you. Can you recommend a online documentation for reading?
– Alexandre Teles
Aug 31 '12 at 14:21
Please see my edited answer. If you think that this works and it solved your problem (and only then), then please mark my answer as the accepted one as well.
– hytromo
Aug 31 '12 at 15:00
add a comment |
Actually you need a space after the [[
and a space before the ]]
and the ]];
should be all together. Also, it is considered good practice to put #!/bin/bash
as the first line of the script so that execution knows which shell to use.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
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',
autoActivateHeartbeat: false,
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
});
}
});
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%2faskubuntu.com%2fquestions%2f182545%2fbash-command-not-found%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Better use:
if [[ "$(uname -m)" == "x86_64" ]]; then
Notice the space between [[
and first parameter, two =
signs , and the space between "x86_64"
and ]]
Also, it is not a good idea to include !
inside echo :)
I think that that's the best place to refer to when doing such operations: http://mywiki.wooledge.org/BashPitfalls
This works. Thank you. Can you recommend a online documentation for reading?
– Alexandre Teles
Aug 31 '12 at 14:21
Please see my edited answer. If you think that this works and it solved your problem (and only then), then please mark my answer as the accepted one as well.
– hytromo
Aug 31 '12 at 15:00
add a comment |
Better use:
if [[ "$(uname -m)" == "x86_64" ]]; then
Notice the space between [[
and first parameter, two =
signs , and the space between "x86_64"
and ]]
Also, it is not a good idea to include !
inside echo :)
I think that that's the best place to refer to when doing such operations: http://mywiki.wooledge.org/BashPitfalls
This works. Thank you. Can you recommend a online documentation for reading?
– Alexandre Teles
Aug 31 '12 at 14:21
Please see my edited answer. If you think that this works and it solved your problem (and only then), then please mark my answer as the accepted one as well.
– hytromo
Aug 31 '12 at 15:00
add a comment |
Better use:
if [[ "$(uname -m)" == "x86_64" ]]; then
Notice the space between [[
and first parameter, two =
signs , and the space between "x86_64"
and ]]
Also, it is not a good idea to include !
inside echo :)
I think that that's the best place to refer to when doing such operations: http://mywiki.wooledge.org/BashPitfalls
Better use:
if [[ "$(uname -m)" == "x86_64" ]]; then
Notice the space between [[
and first parameter, two =
signs , and the space between "x86_64"
and ]]
Also, it is not a good idea to include !
inside echo :)
I think that that's the best place to refer to when doing such operations: http://mywiki.wooledge.org/BashPitfalls
edited Dec 30 '18 at 8:42
Sergiy Kolodyazhnyy
70.6k9147310
70.6k9147310
answered Aug 31 '12 at 10:38
hytromohytromo
3,43632255
3,43632255
This works. Thank you. Can you recommend a online documentation for reading?
– Alexandre Teles
Aug 31 '12 at 14:21
Please see my edited answer. If you think that this works and it solved your problem (and only then), then please mark my answer as the accepted one as well.
– hytromo
Aug 31 '12 at 15:00
add a comment |
This works. Thank you. Can you recommend a online documentation for reading?
– Alexandre Teles
Aug 31 '12 at 14:21
Please see my edited answer. If you think that this works and it solved your problem (and only then), then please mark my answer as the accepted one as well.
– hytromo
Aug 31 '12 at 15:00
This works. Thank you. Can you recommend a online documentation for reading?
– Alexandre Teles
Aug 31 '12 at 14:21
This works. Thank you. Can you recommend a online documentation for reading?
– Alexandre Teles
Aug 31 '12 at 14:21
Please see my edited answer. If you think that this works and it solved your problem (and only then), then please mark my answer as the accepted one as well.
– hytromo
Aug 31 '12 at 15:00
Please see my edited answer. If you think that this works and it solved your problem (and only then), then please mark my answer as the accepted one as well.
– hytromo
Aug 31 '12 at 15:00
add a comment |
Actually you need a space after the [[
and a space before the ]]
and the ]];
should be all together. Also, it is considered good practice to put #!/bin/bash
as the first line of the script so that execution knows which shell to use.
add a comment |
Actually you need a space after the [[
and a space before the ]]
and the ]];
should be all together. Also, it is considered good practice to put #!/bin/bash
as the first line of the script so that execution knows which shell to use.
add a comment |
Actually you need a space after the [[
and a space before the ]]
and the ]];
should be all together. Also, it is considered good practice to put #!/bin/bash
as the first line of the script so that execution knows which shell to use.
Actually you need a space after the [[
and a space before the ]]
and the ]];
should be all together. Also, it is considered good practice to put #!/bin/bash
as the first line of the script so that execution knows which shell to use.
answered Sep 1 '12 at 23:37
Hey GaryHey Gary
911
911
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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%2faskubuntu.com%2fquestions%2f182545%2fbash-command-not-found%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