$ sign in the commands

Dwain Beckford February 10, 2016

This question is in reference to Atlassian Documentation: Set up Git

It would help to not put the $ sign in the commands, it is kinda confusing at first

1 answer

0 votes
Baskar Annamalai
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 10, 2016
Hi there,
Traditionally, a shell prompt either ends with $, % or #. If it ends with $, this indicates a shell that's compatible with the Bourne shell (such as a POSIX shell, or a Korn shell, or Bash). If it ends with %, this indicates a C shell (csh or tcsh). If it ends with #, this indicates that the shell is running as the system's superuser account (root), and that you should be extra careful.

Prompts are often highly individualized. Your Bash prompt will probably be much longer than $.

Also in Bash, $ usually means "Expand". It is not part of your variable name! You can expand "$variable" content, "$(command)" output or "$((arithmetic))" results.

Used as a special parameter $ expands to the PID of the shell: echo $$

Bash also supports $"..." quoting syntax for locale-specific translation. If the current locale is C or POSIX, the dollar sign is ignored. If the string is translated and replaced, the replacement is double-quoted.

Bash also has a special form of quoting, $'string' in which backslash-character combinations are expanded. For example, echo $'this is a literal tab: \t'

$[...] is an obsolete, deprecated syntax for math.

Regards,
Baskar.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events