Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

\curl ... | bash ... what's the slash for? [duplicate]

Tags:

bash

shell

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?

like image 690
pagid Avatar asked Apr 11 '13 14:04

pagid


People also ask

What does double\\ mean in path?

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.

What does double slash mean in unix?

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.

What does double slash mean in bash?

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.

What is meaning of slash in Linux?

Slash is the path separator in Linux. We use it to separate the current directory (.) from the file name.


1 Answers

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.

like image 115
fedorqui 'SO stop harming' Avatar answered Oct 06 '22 02:10

fedorqui 'SO stop harming'