Gentoo Archives: gentoo-user

From: Alexander Kapshuk <alexander.kapshuk@×××××.com>
To: Gentoo mailing list <gentoo-user@l.g.o>
Subject: Re: [gentoo-user] profile-sync-daemon "bad substitution" at boot
Date: Thu, 06 Sep 2018 08:23:22
Message-Id: CAJ1xhMW+WSNU8ohy5BS9o8TZ5WcfjZra8W-Qc5WVdwYNe13Yvw@mail.gmail.com
In Reply to: Re: [gentoo-user] profile-sync-daemon "bad substitution" at boot by Alexander Kapshuk
1 On Thu, Sep 6, 2018 at 11:18 AM Alexander Kapshuk
2 <alexander.kapshuk@×××××.com> wrote:
3 >
4 > On Thu, Sep 6, 2018 at 10:48 AM Samuraiii <samurai.no.dojo@×××××.com> wrote:
5 > >
6 > > On 5.9.2018 21:20, Mick wrote:
7 > >
8 > > Hi All,
9 > >
10 > > I just noticed a psd error at boot time:
11 > >
12 > > /usr/bin/profile-sync-daemon: line 325: ${#DIRArr[@]##*/}: bad substitution
13 > >
14 > > Any idea what's brought this about?
15 > >
16 > > Hi,
17 > >
18 > > my bet is that your /bin/sh != /bin/bash and /usr/bin/profile-sync-daemon starts with #!/bin/sh.
19 > >
20 > > The other way around /usr/bin/profile-sync-daemon contains bashishms.
21 > >
22 > > You can try (as a test) to change #!/bin/sh for #!/bin/bash...
23 > >
24 > > S
25 >
26 > The shebang in the master repository is '#!/bin/bash'.
27 > https://raw.githubusercontent.com/graysky2/profile-sync-daemon/master/common/profile-sync-daemon.in
28 >
29 > The error message is a shell parameter expansion syntax error, which
30 > comprises two different expansion constructs referenced below.
31 > ${#parameter}
32 > String Length.
33 >
34 > ${parameter##[word]}
35 > Remove Largest Prefix Pattern.
36 >
37 > See section 2.6.2 Parameter Expansion,
38 > http://pubs.opengroup.org/onlinepubs/9699919799/nframe.html.
39 >
40 > The script in the master repository referenced above does not contain
41 > the line in question. It has '${#DIRArr[@]/}' and '${DIRArr[@]##*/}'.
42
43 This appears to have been reported as a bug in Debian [1]
44 [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=839049
45 And applied upstream [2].
46 https://github.com/graysky2/profile-sync-daemon/pull/185/files/654f5359abfe7aab2e1616dd74c8ba0f76ce4ab4

Replies

Subject Author
Re: [gentoo-user] profile-sync-daemon "bad substitution" at boot Mick <michaelkintzios@×××××.com>