From: Pavel Šimerda Date: Mon, 13 Apr 2015 14:00:58 +0000 (+0200) Subject: cbq: fix find syntax in example X-Git-Tag: v4.1.0~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a51842dcd77200159e091da8b2e38e428652532d;p=thirdparty%2Fiproute2.git cbq: fix find syntax in example Without modification, using the example resulted in the following error: [root@localhost sbin]# cbq restart find: warning: you have specified the -maxdepth option after a non-option argument (, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it). Please specify options before other arguments. find: warning: you have specified the -maxdepth option after a non-option argument (, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it). Please specify options before other arguments. **CBQ: failed to compile CBQ configuration! See also: * https://bugzilla.redhat.com/show_bug.cgi?id=539232 Reported-by: Mads Kiilerich Signed-off-by: Pavel Šimerda --- diff --git a/examples/cbq.init-v0.7.3 b/examples/cbq.init-v0.7.3 index 35a0a05ea..1bc0d446f 100644 --- a/examples/cbq.init-v0.7.3 +++ b/examples/cbq.init-v0.7.3 @@ -578,14 +578,14 @@ cbq_show () { ### Check configuration and load DEVICES, DEVFIELDS and CLASSLIST from $1 cbq_init () { ### Get a list of configured classes - CLASSLIST=`find $1 \( -type f -or -type l \) -name 'cbq-*' \ - -not -name '*~' -maxdepth 1 -printf "%f\n"| sort` + CLASSLIST=`find $1 -maxdepth 1 \( -type f -or -type l \) -name 'cbq-*' \ + -not -name '*~' -printf "%f\n"| sort` [ -z "$CLASSLIST" ] && cbq_failure "no configuration files found in $1!" ### Gather all DEVICE fields from $1/cbq-* - DEVFIELDS=`find $1 \( -type f -or -type l \) -name 'cbq-*' \ - -not -name '*~' -maxdepth 1| xargs sed -n 's/#.*//; \ + DEVFIELDS=`find $1 -maxdepth 1 \( -type f -or -type l \) -name 'cbq-*' \ + -not -name '*~' | xargs sed -n 's/#.*//; \ s/[[:space:]]//g; /^DEVICE=[^,]*,[^,]*\(,[^,]*\)\?/ \ { s/.*=//; p; }'| sort -u` [ -z "$DEVFIELDS" ] &&