22

In Installing RVM manual I see a lot of lines starting with '\':

Install RVM with ruby:

$ \curl -L https://get.rvm.io | bash -s stable --ruby

I'd think it is just mistype but they repeat it many times.

So what is the reason?

Gilles Quenot
  • 1,150
  • 9
  • 15
Putnik
  • 2,095
  • 3
  • 23
  • 40

2 Answers2

26

There's no error, it's a little hack to avoid using a curl shell alias if any exists.

This works too :

'curl' (...)
"curl" (...)
/usr/bin/curl (...)
command curl (...)
command -p curl (...)
Gilles Quenot
  • 1,150
  • 9
  • 15
  • That tells what the backslash does, still not why they put it there... is curl often alias'ed? Otherwise you could put it in any manual before every command. – Frank Meulenaar Feb 24 '13 at 07:41
  • 1
    maybe they wanted to prevent unwanted options, with an alias like `curl='curl -foo'` – sendmoreinfo Feb 27 '13 at 14:39
9

A command preceded by a slash temporarily disables any aliases for the command.

Bash Shell Temporarily Disable an Alias

Aaron Copley
  • 12,345
  • 5
  • 46
  • 67