ovs-command-compgen: Avoid using GNU sed extensions.
authorAlex Wang <alexw@nicira.com>
Sun, 4 Jan 2015 06:06:43 +0000 (22:06 -0800)
committerAlex Wang <alexw@nicira.com>
Mon, 5 Jan 2015 18:14:49 +0000 (10:14 -0800)
This commit changes '\?' to '\{0,1\}' to avoid using GNU
sed extension.

Found by using the script in FreeBSD.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
utilities/ovs-command-compgen.bash

index a515c1d..fa3f1e6 100755 (executable)
@@ -191,7 +191,7 @@ subcmd_find_comp_based_on_input() {
         fi
         # Trims the 'combs', keeps context only after 'kword'.
         if [ -n "$combs" ]; then
-            combs="$(sed -n "s@^.*\[\?$kword|\?[a-z_]*\]\? @@p" <<< "$combs")"
+            combs="$(sed -n "s@^.*\[\{0,1\}$kword|\{0,1\}[a-z_]*\]\{0,1\} @@p" <<< "$combs")"
         fi
     done
     comps="$(find_possible_comps "$combs")"