$ 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 votes
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
Community showcase
Published Tuesday in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

166 views 3 6
Read article

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