这是indexloc提供的服务,不要输入任何密码
Skip to content

Commit fee0c44

Browse files
Added: Update arguments processing docs to be more clear
1 parent f7401b7 commit fee0c44

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ Execute permissions will automatically be set for the executable file if it exis
146146
147147
The `Arguments` text field defines the argument that will be passed to the executable. For `Termux:Tasker` version `>= 0.5`, arguments will be processed just like there are if commands are run in a shell like bourne shell. It uses [ArgumentTokenizer](https://sourceforge.net/p/drjava/git_repo/ci/master/tree/drjava/src/edu/rice/cs/util/ArgumentTokenizer.java) to parse the arguments string.
148148
149-
Arguemnts are split on whitespaces unless quoted with single or double quotes. Double quotes and backslashes can be escaped with backslashes in arguments surrounded with double quotes.
149+
Arguemnts are split on a space ` `, tab `\t` or a newline `\n` ([`Character.isWhitespace()`](https://developer.android.com/reference/java/lang/Character#isWhitespace(char))) unless quoted with single `'` or double quotes `"`. Double quotes and backslashes can be escaped with backslashes in arguments surrounded with double quotes. Using backslash at end of line (`\\n`) to start a new argument is not supported and it will escape the newline and add it to start of the new argument. Internally, [`ArgumentTokenizer`](https://github.com/termux/termux-app/blob/master/termux-shared/src/main/java/com/termux/shared/shell/ArgumentTokenizer.java) class is using to convert the arguments string to separate arguments.
150150
151151
Any argument surrounded with single quotes is considered a literal string. However, if an argument itself contains single quotes, then they will need to be escaped properly. You can escape them by replacing all single quotes `'` in an argument value with `'\''` **before** passing the argument surrounded with single quotes. So an argument surrounded with single quotes that would have been passed like `'some arg with single quote ' in it'` will be passed as `'some arg with single quote '\'' in it'`. This is basically 3 parts `'some arg with single quote '`, `\'` and `' in it'` but when processed, it will be considered as one single argument with the value `some arg with single quote ' in it` that is passed to the executable.
152152

0 commit comments

Comments
 (0)