looking at the magic installers which appear for all types of projects (e.g. for rvm) you'll always see commands like:
\curl ... | bash
e.g.
\curl -L https://get.rvm.io | bash -s stable
And I was wondering why these commands start with a slash - they seem to run fine without it.
Any suggestions?
Actually it means nothing and is ignored. This often happens when output from multiple places is combined and it isn't clear who's job it is to add the slashes, so both parties do it and you end up with two of them. Semantically in the case of a directory path is has no meaning and will be ignored by most programs.
Also the Unix standards states: A pathname that begins with two successive slashes may be interpreted in an implementation-defined manner, although more than two leading slashes shall be treated as a single slash. Follow this answer to receive notifications.
Thats a replacement pattern using bash parameter expansion. In ${f// /_} : The double slashes // are for replacing all occurrences of space with _ , if you put one slash / , only first space is going to be replaced.
Slash is the path separator in Linux. We use it to separate the current directory (.) from the file name.
This is used to call the "original" command, avoiding it to be called with the possible aliases. That is, disables the possible aliases on the command curl
and adjusts to the original one.
If you have
alias grep='grep --color=auto'
and then you do grep
, it will have colours. So if you do not want colours, you would just write \grep
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With