Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a script that needs to know the processor architecture. I'm doing this way:

if [["$(uname -m)" = "x86_64"]]; then
echo "Nossa! Você só pode usar 3,5GB de memória RAM. Que triste :( Vou baixar a versão 32bits pra você tá?"

But when I execute the code, I receive: line 35: [[x86_64: command not found

Anyone can help me to solve this? Thanks!

share|improve this question
up vote 5 down vote accepted

Better use:

if [[ "$(uname -m)" == "x86_64" ]]; then

Notice the two = 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:

share|improve this answer
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. – hakermania Aug 31 '12 at 15:00

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.