23

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?

3
  • Cross-site duplicate: stackoverflow.com/questions/15691977/…
    – tripleee
    Nov 7, 2023 at 14:08
  • @tripleee According to "What topics can I ask about here? " for both Serverfault and Stackoverflow, Linux shell questions are better posted here, not there.
    – Putnik
    Nov 19, 2023 at 15:41
  • I can't see what makes you believe that. Anyway, the link is just to make visitors aware that there are more and different answers on Stack Overflow.
    – tripleee
    Nov 19, 2023 at 16:48

2 Answers 2

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 (...)
2
  • 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. Feb 24, 2013 at 7:41
  • 1
    maybe they wanted to prevent unwanted options, with an alias like curl='curl -foo' Feb 27, 2013 at 14:39
9

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

Bash Shell Temporarily Disable an Alias

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .