Jump to content

Can i get help here?

- - - - -

  • Please log in to reply
3 replies to this topic

#1
untitled_1

untitled_1

    Learning Programmer

  • Members
  • PipPipPip
  • 89 posts
This code doesnt work properly, it gives an error about the two variables, i am using bash in Linux mint 10(32bit), every time i try declare variables COLOR and VALUE i get an error that says "Command not found:

#!/bin/bash

COLOR = "Black"
VALUE = "9"

printf "Hi, "$USER

printf "\nlist of connected users: \n"
w
printf "This is a string: " $COLOR
printf "\nAnd this is a number: " $VALUE
printf "\n"

printf "\nScript finished\n"

#2
Carver413

Carver413

    Newbie

  • Members
  • PipPip
  • 13 posts
you need to remove the spaces

COLOR="Black"

LSST v1.05r3 > Chapter 2 > Rules for Naming variable name (Both UDV and System Variable)

#3
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
  • Location:Vancouver, Eh! Cleverness: 200
Ah yes, variable assignment is done with no spaces, variable comparison is done with spaces.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#4
untitled_1

untitled_1

    Learning Programmer

  • Members
  • PipPipPip
  • 89 posts
Oh, I see, thanks guys




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users