action #34123


[kernel]wicked_basic: invalid bash syntax

Added by dimstar about 6 years ago. Updated over 5 years ago.

Bugs in existing tests
Target version:
Start date:
Due date:
% Done:


Estimated time:


# Result:
for dev in /sys/class/net/!(lo); do grep "down" $dev/operstate || (echo "device $dev is not down" && exit 1) ; done ; echo wKUv9-$?-
-bash: !: event not found

Actions #1

Updated by okurz about 6 years ago

  • Subject changed from wicked_basic: invalid bash syntax to [kernel]wicked_basic: invalid bash syntax
  • Category set to Bugs in existing tests
  • Assignee set to asmorodskyi
Actions #2

Updated by asmorodskyi about 6 years ago

PR which suppose to solve problem :

But currently it still failing , so need further investigations :

Actions #3

Updated by dimstar about 6 years ago

Trying to summarize why this problem appeared all of a sudden and some specialties observed.

The command used by the test is/was:
for dev in /sys/class/net/!(lo); do ...; done

Now, '!' is the character for history expansion. History expansion is automatically disabled in some cases inside a command. According to the bash man page:

Several characters inhibit history expansion if found immediately following the history expansion cheven if it
is unquoted: space, tab, newline, carriage return, and =. If the extglob shell option is enabled, ( will also inhibit

so, !( (from !(lo) ) is treated differently if extglob is enabled or disabled.

As for the reason why extglob status changed:

systemd had previously recommended systemd-bash-completion, which in turn required bash-completion. AS this was only one split out, and the same was not done for other shell-completions, the package was merged back into the main systemd package. As this is not explicitly bound to a shell in use, it does neither recommend not require bash-completion (which makes sense).

This, in turn," resulted in bash-completion no longer being auto-installed on a system (I submitted a pattern change to explicitly enable it on regular systems, as users of bash certainly profit from it)

bash-completion itself enables shopt extglob, which is how this all ever worked to start with. Merely a lot of luck

Actions #4

Updated by asmorodskyi about 6 years ago

Issue fixed by moving everything into sh script

Actions #5

Updated by asmorodskyi about 6 years ago

  • Status changed from New to In Progress
Actions #6

Updated by sebchlad about 6 years ago

  • Target version set to 448
Actions #7

Updated by asmorodskyi almost 6 years ago

  • Status changed from In Progress to Resolved
Actions #8

Updated by sebchlad over 5 years ago

  • Target version changed from 448 to 445
Actions #9

Updated by sebchlad over 5 years ago

  • Target version changed from 445 to Done

Also available in: Atom PDF