Undollar -$ Shell Commands
This post aims to eliminate one trouble from your workflow with a little tweak.
When you copy+paste some command from internet, you usually can’t run it
AS-IS. Since there is a $
(dollar) sign in front of the command.
Take as an example below git
command:
$ git checkout -b develop
After copy+paste+run you will get an error like below:
bash: $: command not found
I -and people, put $
sign as an default and generic prompt indicator for
shell/bash commands, however this can be annoying while running it.
We can avoid this error by adding an alias
for it:
# ~/.aliases
alias '$'=''
# or
# alias \$'=''
This strips the dollar sign from the beginning of the terminal command you copied from internet.
All done!
Subscribe
Read Related