So to enter a directory or a file with a special character, escape the latter with \, e.g.: cd space\ dir # change into directory called “space dir”Ĭat space\ file # print the content of file “space file”Įcho content > \\ # print “content” into file “\”īash's Programmable Completion (aka Tab ↹ Completion) automatically escapes special characters with the escape character \. It preserves the literal value of the next character that follows, with the exception of. Quoting with the escape character \Ī non-quoted backslash ( \) is the escape character. (…) There are three quoting mechanisms: the escape character, single quotes, and double quotes. Quoting is used to remove the special meaning of certain characters or words to the shell. What you're asking for is called Quoting: Tab ↹ Completion takes care of proper quoting. Tl dr: To quote a special character either escape it with a backslash \ or enclose it in double " " or single quotes ' '.
0 Comments
Leave a Reply. |