What does a backslash mean in a script?

What does a backslash mean in a script?

A backslash at the end of a line in a shell script makes the shell ignore the newline for the purposes of executing the script. This is normally used to split long lines in a script file into multiple text lines, which will be handeled as a single script line by the shell.

What does backslash mean in curl?

alias curl=’curl –some –default –options’ If you have an alias for curl and you don’t want to use it, putting a backslash in front disables the alias and runs the curl binary directly.

What is a backslash in Linux?

The backslash is an upward-to-the-left sloping straight line character that is used mostly in a computer context. Its main use in Unix-like operating systems and in some programming languages (e.g., C and Perl) is as an escape character, that is, to indicate that the following character has a special meaning.

Which is the backslash key?

Creating the \ symbol on a U.S. keyboard On English PC and Mac keyboards, the backslash key is also the pipe key. It is located above the Enter key (Return key), and below the Backspace key. Pressing \ key creates a backslash.

What does backslash mean in bash?

escape character
A non-quoted backslash ‘ \ ‘ is the Bash escape character. It preserves the literal value of the next character that follows, with the exception of newline .

What is use of Alt Gr key?

AltGr (also Alt Graph) is a modifier key found on many computer keyboards (rather than a second Alt key found on US keyboards). It is primarily used to type characters that are not widely used in the territory where sold, such as foreign currency symbols, typographic marks and accented letters.

Is the backslash a literal character in POSIX?

Inside character classes, the backslash is a literal character in POSIX regular expressions. You cannot use it to escape anything. You have to use “clever placement” if you want to include character class metacharacters as literals.

What’s the difference between regex and POSIX bracket expressions?

A major difference between POSIX bracket expressions and the character classes in other regex flavors is that POSIX bracket expressions treat the backslash as a literal character. This means you can’t use backslashes to escape the closing bracket (]), the caret (^) and the hyphen (-).

What to use instead of grep-P in POSIX?

Use grep -P instead. POSIX introduced “bracket expressions” which are a special kind of character classes. POSIX bracket expressions match one character out of a set of characters, just like regular character classes. They use the same syntax with square brackets. A hyphen creates a range, and a caret at the start negates the bracket expression.

Can you escape any characters in POSIX ere?

Escaping any other characters is an error with POSIX ERE. Inside character classes, the backslash is a literal character in POSIX regular expressions. You cannot use it to escape anything.