LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Meaing of the '$' in a command. (https://www.linuxquestions.org/questions/linux-newbie-8/meaing-of-the-%24-in-a-command-899719/)

swamprat 08-26-2011 08:56 PM

Meaing of the '$' in a command.
 
I have the following command which I think must be changed.

Is the $ a variable and should I change it to my names?

mydestination = $myhostname localhost.$mydomain localhost $mydomain

Should $myhostname be changed something like my host name such as

mydestination = $spacewalker localhost.$spacewalker localhost $spacewalker

If the $ is a variable should I leave it off?

Thanks

bentbrewer 08-26-2011 09:29 PM

It may be indicating a variable, but I think the entire word would be indicating a variable.

$myhostname = spacewalker
$mydomain = local

Unless you are on a domain...

Tinkster 08-26-2011 09:40 PM

Quote:

Originally Posted by swamprat (Post 4454577)
I have the following command which I think must be changed.

Is the $ a variable and should I change it to my names?

mydestination = $myhostname localhost.$mydomain localhost $mydomain

Should $myhostname be changed something like my host name such as

mydestination = $spacewalker localhost.$spacewalker localhost $spacewalker

If the $ is a variable should I leave it off?

Thanks


It would be nice if you gave people some context - where did
you dig these lines up? Is it code, is it a config file?
What is its purpose?


Cheers,
Tink

grail 08-26-2011 11:43 PM

I would also add that looking at the example so far there are no commands at all. What I see is a variable being set to a value, but as Tink says, for what
we have no idea without context.

swamprat 08-27-2011 12:18 PM

Sorry about that, I remember getting it from the main.cf file in Postfix

cheddarcheese 08-27-2011 05:03 PM

Yes, it is from the main.cf config file in Postfix. The file "... specifies a very small subset of all the parameters that control the operation of the Postfix mail system ..."

If you do a Google search for the entire string "mydestination = $myhostname localhost.$mydomain localhost $mydomain" then you'll see numerous Postfix-related sites which deal with it in one way or the other.

A good start would be at the following Postfix page:

www.postfix.org/BASIC_CONFIGURATION_README.html

Knightron 08-28-2011 04:38 AM

Hello, i'm not entirely sure what you mean, but i'm just gonna throw this out there. if you're talking about the dollar sign after your users name, that just indicates you're signed as a user. as root it will no longer display a dollar sign but instead a hash, "#".

MTK358 08-28-2011 06:09 AM

Quote:

Originally Posted by Knightron (Post 4455324)
Hello, i'm not entirely sure what you mean, but i'm just gonna throw this out there. if you're talking about the dollar sign after your users name, that just indicates you're signed as a user. as root it will no longer display a dollar sign but instead a hash, "#".

Fist of all, that's clearly not what the OP is talking about, and second, very few shell prompts (I think thais is what you're talking about) I've seen consist of the username followed by a "$".

Knightron 08-28-2011 04:40 PM

hey calm down, if im talking about the wrong thing then the op can just ignore my post, no halm done. as for the shell, ive only used bash, so i'm not aware of how others display.

MTK358 08-28-2011 05:07 PM

Quote:

Originally Posted by Knightron (Post 4455629)
as for the shell, ive only used bash, so i'm not aware of how others display.

bash can be made to use any prompt. AFAIK the default one looks like this:

Code:

bash-X.X$
, where "X.X" is the version number. But most distros make it like this by default:

Code:

username@hostname:current-dir$
.

swamprat 08-30-2011 02:07 PM

mydestination = $myhostname localhost.$mydomain localhost $mydomain

So, I'm really sorry but a simple straight for answer would really help and I know you all have been trying:

Do for the example above is the $myhostname variable change to my name such as $spacewalker???

BTW, I'm on the U.S. East Coast and couldn't answer before because of electrice outages.

cheddarcheese 08-30-2011 02:32 PM

I really think you'd find more help at a site dealing with Postfix issues, such as the one I suggested a day or two back. It is a Postfix file, and you're asking about Postfix configuration.


All times are GMT -5. The time now is 12:32 AM.