Commit a51842dc authored by Pavel Šimerda's avatar Pavel Šimerda Committed by Stephen Hemminger

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=539232Reported-by: default avatarMads Kiilerich <mads@kiilerich.com>
Signed-off-by: default avatarPavel Šimerda <psimerda@redhat.com>
parent 11a3e5c4
...@@ -578,14 +578,14 @@ cbq_show () { ...@@ -578,14 +578,14 @@ cbq_show () {
### Check configuration and load DEVICES, DEVFIELDS and CLASSLIST from $1 ### Check configuration and load DEVICES, DEVFIELDS and CLASSLIST from $1
cbq_init () { cbq_init () {
### Get a list of configured classes ### Get a list of configured classes
CLASSLIST=`find $1 \( -type f -or -type l \) -name 'cbq-*' \ CLASSLIST=`find $1 -maxdepth 1 \( -type f -or -type l \) -name 'cbq-*' \
-not -name '*~' -maxdepth 1 -printf "%f\n"| sort` -not -name '*~' -printf "%f\n"| sort`
[ -z "$CLASSLIST" ] && [ -z "$CLASSLIST" ] &&
cbq_failure "no configuration files found in $1!" cbq_failure "no configuration files found in $1!"
### Gather all DEVICE fields from $1/cbq-* ### Gather all DEVICE fields from $1/cbq-*
DEVFIELDS=`find $1 \( -type f -or -type l \) -name 'cbq-*' \ DEVFIELDS=`find $1 -maxdepth 1 \( -type f -or -type l \) -name 'cbq-*' \
-not -name '*~' -maxdepth 1| xargs sed -n 's/#.*//; \ -not -name '*~' | xargs sed -n 's/#.*//; \
s/[[:space:]]//g; /^DEVICE=[^,]*,[^,]*\(,[^,]*\)\?/ \ s/[[:space:]]//g; /^DEVICE=[^,]*,[^,]*\(,[^,]*\)\?/ \
{ s/.*=//; p; }'| sort -u` { s/.*=//; p; }'| sort -u`
[ -z "$DEVFIELDS" ] && [ -z "$DEVFIELDS" ] &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment