pkg_libchk

I don't know if it's a bug or my enviroment. Pkg_libchk shows on the begin of the output more than a dozen (After begin not more of this)
Code:
grep: Unmatched [ or [^
Only on Bash-4.3.30(0). (Works without problems on csh). .
On FreeBSD-10.0 the problem is solved with recompile the port (sysutils/bsdadminscripts). On FreeBSD-9.3 I had to
Change in line 211 of /usr/local/sbin/pkg_libchk

:
Code:
grep -E "^[[:space:]]*OS/ABI:[[:space:]]*UNIX - $osname\
$" \
the double-quotes in single-quotes.

(But curious: in FreeBSD-10.0 works this line with double-quotes).

I only want to know, if someone other has the same problem, or it's only mine.
 
I found "half" the reason: the command pkg_libchk (with double-quotes on 9.3) brings the error, /usr/local/sbin/pkg_libchk not.
But /usr/local/sbin is in $PATH.
 
Something wrong is with that. Update to bsdadminscripts-6.1.1_8. Now the error is on both Freebsd-9.3 and 10.0.
Works with sudo. pkg_libchk - has ever worked without sudo. Error the same as above. With double-quotes works with root, with single-quotes as user. ......
 
I don't know about others, but I can't tell what you mean by "with double-quotes". Show exact examples of what you type and the error message. It might be a problem with a bash built-in. But pkg_libchk specifies /bin/sh as an interpreter. For a problem to happen would mean /bin/sh has been linked to bash a Linuxism that will break on FreeBSD.
 
Your description is not clear, mixes together "with double quotes", "with single quotes", different versions of FreeBSD, sudo, and who knows what else. Instead of throwing it all in a bucket and describing it with ambiguous words, just show it:

On FreeBSD 10.1, I did this:
Code:
% pkg_libchk ""
vague error
% "pkg_libchk"
unknown error
% 'pkg_libchk'
mysterious error
% sudo . pkg_libchk
what?
 
this is the error
grep: Unmatched [ or [^
this is the original line (211) in /usr/local/sbin/pkg_libchk
grep -E "^[[:space:]]*OS/ABI:[[:space:]]*UNIX - $osname\ $" \
with double-quotes the error appears
This only in bash and if I used it with normal user (group wheel)
If I use it with sudo the error doesn't appear.
(I changed this) with single-quotes it doesn't appear.


Code:
ls -al /usr/local/sbin/pkg_libchk
-r-xr-xr-x  1 root  wheel  11961  8 Nov 00:46 /usr/local/sbin/pkg_libchk
 
I found it, it's a bug, an escape error
the line
Code:
grep -E "^[[:space:]]*OS/ABI:[[:space:]]*UNIX - $osname\$" \

should be ($ with two backslashes)
Code:
grep -E "^[[:space:]]*OS/ABI:[[:space:]]*UNIX - $osname\\$" \
 
Back
Top