$ sign in the commands

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 vote
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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

22,358 views 26 12
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you