From 692f2f3c9dfd6a1d6692e6f131e4e40c02f7f1bc Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sun, 5 Mar 2017 19:55:13 +0100 Subject: [PATCH] subcommand: Use POSIX compatible command regex. The POSIX way to ask for one or more matches of the preceeding atom is {1,} while the plus character is a non-portable shortcut. Note that since the closing brace of the regex bound is inside parameter expansion, we need to escape it with a backslash while the opening brace must not be escaped. --- subcommand | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subcommand b/subcommand index 261e35f..ca546bd 100644 --- a/subcommand +++ b/subcommand @@ -25,7 +25,7 @@ _gsu_usage() # exactly one parenthesized subexpression for matching the command name. _gsu_get_command_regex() { - local cmd="${1:-[-a-zA-Z_0-9]+}" + local cmd="${1:-[-a-zA-Z_0-9]{1,\}}" result="^com_($cmd)\(\)" } -- 2.39.2