Improve this question. Gilles 'SO- stop being evil' k gold badges silver badges bronze badges. It is not at all clear what you are trying to do. And what has autocompletion got to do with anything? MichaelVehrs I have command mv filename filename-foo in bash, which characters do I need to escape, besides spaces and parenthesis? MichaelVehrs removed autocomplete mention. Basically, all shell metacharacters, such as whitespace, shell globs, history events.
MichaelVehrs I know that quoting will solve the issue with escaping but I need to use filename without quotes. I have terminal emulator and it should work when user don't use quotes. Show 1 more comment. Active Oldest Votes. Thus the file name This file's name has some weird characters! Will you manage to escape them?
Whitespace space, tab, newline — remembering that newlines can't be quoted with a backslash. A few more characters can require special handling sometimes: - isn't special for the shell, but when it's at the beginning of a command argument, it indicates an option. If you choose a character that has a special meaning in a BRE and you want to include it literally, you'll need three backslashes; I do not recommend this, as it may behave differently in some implementations.
Skip to content quoting sed shell-script Take the following script:! Best Answer. Escape Characters 7. Loops 8. Test 9. Case Variables Part 2 Variables Part 3 External Programs Functions Hints and Tips Quick Reference You can use wildcards in the string, but you must quote them, so that the find command itself can match them against names of files in each directory it searches. The command find.
You can also use a backslash to include double quotes within a quoted string. You can get around this limitation in various ways.
First, try eliminating the quotes:. If no other characters are special as is the case here , this works. Otherwise, you can use the following command:. A related issue is how to continue the text of a command beyond a single line on your terminal or workstation window. You can do this in two ways: by ending a line with a backslash, or by not closing a quote mark i.
If you use the backslash, there must be nothing between it and the end of the line—not even spaces or TABs. Whether you use a backslash or a single quote, you are telling the shell to ignore the special meaning of the RETURN character. You can continue a line as many times as you wish. Perhaps the most difficult thing about control keys is that they can differ from system to system. The usual arrangement is shown in Table 1.
0コメント