http://bugzilla.novell.com/show_bug.cgi?id=587428
http://bugzilla.novell.com/show_bug.cgi?id=587428#c4
--- Comment #4 from Marius Tomaschewski
User-Agent: Mozilla/5.0 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko) SUSE
It appears to me that
/etc/sysconfig/network/scripts/functions
is not /bin/sh compatible.
I'm not sure if it is /bin/bash but would doubt it too.
It _is_ bash and no, it isn't sh compatible. All scripts in sysconfig require bash and they use #!/bin/bash at the begin. BTW: Most of the scripts in openSUSE require bash. I'll also not change to become sh compatible. There is no reason for use and it would require that some features can't be used any more, e.g. regex - it makes completely no sense to reinvent the wheel. This special example is maybe not needed in sysconfig, but it is possible in bash >= 3.x: pat='^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)([?]([^#]*))?(#(.*))?' str='https://bugzilla.novell.com/show_bug.cgi?id=587428#add_comment' if [[ $str =~ $pat ]] ; then declare -i i for ((i=0;i<${#BASH_REMATCH[@]};i++)) ; do echo "[$i] ${BASH_REMATCH[$i]}" done fi [0] https://bugzilla.novell.com/show_bug.cgi?id=587428#add_comment [1] https: [2] https [3] //bugzilla.novell.com [4] bugzilla.novell.com [5] /show_bug.cgi [6] ?id=587428 [7] id=587428 [8] #add_comment [9] add_comment [...]
I would say a shell-construct like
while ..
do < <(command)
is not allowded. better use
See "man bash", "Process Substitution". It is normal bash syntax, that opens a fifo `<()' as normal standard input for all command in the while loop.
I think that most of network-script is working is that these> functions are not used in many cases.
Sorry, but this is nonsense.
A pool of computers did not start network due to this error.
Then don't try to use /bin/sh when a script is using /bin/bash at the begin.
Please rethink also programming-style of
/etc/init.d/network
Code around line 49:
if ! . scripts/functions 2>/dev/null; then echo -n "Network: file /etc/sysconfig/network/scripts/functions is missing." rc_failed rc_status -v rc_exit fi
I my case scripts/functions was present, but had a syntactical error but shell-output of that error was redirected to /dev/null. The resulting message "Network: file /etc/sysconfig/network/scripts/functions is missing." was not true and misleading.
Yes, the message is misleading - most of the scripts are quite old, written by many people having different styles and could get some some cleanup. I'll fix the above when I not forget it, but there are more urgent things to cleanup than the above message. And no, there is no syntax error. Every script in sysconfig verified for correct syntax (bash -n) in every RPM build. => INVALID, try to use wrong shell. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.