librelist archives

« back to archive

Patch for hnu

Patch for hnu

From:
William Martin
Date:
2011-04-12 @ 08:01
Hi,

I have an error when i run the hnu script :
/home/pl/photon/scripts/hnu: 51: [[: not found

I attach a patch to fix it.

William


-- 
---------------------------------------------------------
William MARTIN
wysman @NoSpAm@ gmail @DoT@ com

Re: [photon.users] Patch for hnu

From:
Mehdi Kabab
Date:
2011-04-13 @ 11:44
Hi William,

Your patch is applied in commit 1200738[1].

Thx!

1.

http://projects.ceondo.com/p/photon/source/commit/1200738ac6d6cb2b891015296ce4a4eb71d1bbec/

2011/4/12 William MARTIN <wysman@gmail.com>

> Hi,
>
> I have an error when i run the hnu script :
> /home/pl/photon/scripts/hnu: 51: [[: not found
>
> I attach a patch to fix it.
>
> William
>
>
> --
> ---------------------------------------------------------
> William MARTIN
> wysman @NoSpAm@ gmail @DoT@ com
>



-- 
Mehdi Kabab
Développeur Web / Auteur

CV : http://mehdi.kabab.name/
Livre : http://gimp4you.eu.org/livre/
Code : http://pioupioum.fr/
Twitter: http://twitter.com/piouPiouM

Re: [photon.users] Patch for hnu

From:
Loic d'Anterroches
Date:
2011-04-13 @ 09:17
Hello,

> I have an error when i run the hnu script :
> /home/pl/photon/scripts/hnu: 51: [[: not found

Could you provide us with a bit more information? I was sure that [[ was
part of all the shell builtins.

Do you know which /bin/sh are you using?

loïc

Re: [photon.users] Patch for hnu

From:
William Martin
Date:
2011-04-13 @ 09:57
Hello,

"[[" is not a build in function of dash, which is use by ubuntu
You can reproduce the error with that code :

$ dash
$ echo Hello
Hello
$ if [[ $? == 0 ]]; then
> sleep 1
> fi
dash: [[: not found


William

On Wed, Apr 13, 2011 at 11:17 AM, Loic d'Anterroches <loic@ceondo.com> wrote:
> Hello,
>
>> I have an error when i run the hnu script :
>> /home/pl/photon/scripts/hnu: 51: [[: not found
>
> Could you provide us with a bit more information? I was sure that [[ was
> part of all the shell builtins.
>
> Do you know which /bin/sh are you using?
>
> loïc
>



-- 
---------------------------------------------------------
William MARTIN
wysman @NoSpAm@ gmail @DoT@ com

Re: [photon.users] Patch for hnu

From:
Nicolas
Date:
2011-04-13 @ 11:18
Hello,

Specifying the shell that should be used on top of the scripts would solve
it all.

#/bin/bash

Bash is included in most (if not all) modern linux distros. And this would
allow Photon scripts to work as intended, even when users use another shell
as a default.

Nicolas





On Wed, Apr 13, 2011 at 11:57 AM, William MARTIN <wysman@gmail.com> wrote:

> Hello,
>
> "[[" is not a build in function of dash, which is use by ubuntu
> You can reproduce the error with that code :
>
> $ dash
> $ echo Hello
> Hello
> $ if [[ $? == 0 ]]; then
> > sleep 1
> > fi
> dash: [[: not found
>
>
> William
>
> On Wed, Apr 13, 2011 at 11:17 AM, Loic d'Anterroches <loic@ceondo.com>
> wrote:
> > Hello,
> >
> >> I have an error when i run the hnu script :
> >> /home/pl/photon/scripts/hnu: 51: [[: not found
> >
> > Could you provide us with a bit more information? I was sure that [[ was
> > part of all the shell builtins.
> >
> > Do you know which /bin/sh are you using?
> >
> > loïc
> >
>
>
>
> --
> ---------------------------------------------------------
> William MARTIN
> wysman @NoSpAm@ gmail @DoT@ com
>

Re: [photon.users] Patch for hnu

From:
Thomas Keller
Date:
2011-04-13 @ 15:21
Am 13.04.2011 13:18, schrieb Nicolas:
> Hello,
> 
> Specifying the shell that should be used on top of the scripts would solve
> it all.
> 
> #/bin/bash
> 
> Bash is included in most (if not all) modern linux distros. And this would
> allow Photon scripts to work as intended, even when users use another shell
> as a default.

Please note however that packagers would explicitely need to add bash to
the list of requirements for a possible photon package, since _not_ all
distributions ship with it by default.

Read up on the Wikipedia page [0] why Debian (and Ubuntu) moved away
from bash and why so-called "bashisms" are deprecated. Simple rule to
follow: if you do not _require_ a specific bash feature / syntax, try to
keep sh (dash) compliant.

Thomas.

[0] http://en.wikipedia.org/wiki/Debian_Almquist_shell

-- 
GPG-Key 0x160D1092 | tommyd3mdi@jabber.ccc.de | http://thomaskeller.biz
Please note that according to the EU law on data retention, information
on every electronic information exchange might be retained for a period
of six months or longer: http://www.vorratsdatenspeicherung.de/?lang=en

Re: [photon.users] Patch for hnu

From:
Nicolas
Date:
2011-04-13 @ 15:31
I didn't know about that, and that's definately an interesting read. Thanks.

Nicolas


On Wed, Apr 13, 2011 at 5:21 PM, Thomas Keller <me@thomaskeller.biz> wrote:

> Am 13.04.2011 13:18, schrieb Nicolas:
> > Hello,
> >
> > Specifying the shell that should be used on top of the scripts would
> solve
> > it all.
> >
> > #/bin/bash
> >
> > Bash is included in most (if not all) modern linux distros. And this
> would
> > allow Photon scripts to work as intended, even when users use another
> shell
> > as a default.
>
> Please note however that packagers would explicitely need to add bash to
> the list of requirements for a possible photon package, since _not_ all
> distributions ship with it by default.
>
> Read up on the Wikipedia page [0] why Debian (and Ubuntu) moved away
> from bash and why so-called "bashisms" are deprecated. Simple rule to
> follow: if you do not _require_ a specific bash feature / syntax, try to
> keep sh (dash) compliant.
>
> Thomas.
>
> [0] http://en.wikipedia.org/wiki/Debian_Almquist_shell
>
> --
> GPG-Key 0x160D1092 | tommyd3mdi@jabber.ccc.de | http://thomaskeller.biz
> Please note that according to the EU law on data retention, information
> on every electronic information exchange might be retained for a period
> of six months or longer: http://www.vorratsdatenspeicherung.de/?lang=en
>
>
>

Re: [photon.users] Patch for hnu

From:
Loic d'Anterroches
Date:
2011-04-13 @ 11:27
Ok, piouPiouM is going to test it on OS X and if it works out of the
box, we will just use your version.

On 2011-04-13 11:57, William MARTIN wrote:
> Hello,
> 
> "[[" is not a build in function of dash, which is use by ubuntu
> You can reproduce the error with that code :
> 
> $ dash
> $ echo Hello
> Hello
> $ if [[ $? == 0 ]]; then
>> sleep 1
>> fi
> dash: [[: not found
> 
> 
> William
> 
> On Wed, Apr 13, 2011 at 11:17 AM, Loic d'Anterroches <loic@ceondo.com> wrote:
>> Hello,
>>
>>> I have an error when i run the hnu script :
>>> /home/pl/photon/scripts/hnu: 51: [[: not found
>>
>> Could you provide us with a bit more information? I was sure that [[ was
>> part of all the shell builtins.
>>
>> Do you know which /bin/sh are you using?
>>
>> loïc
>>
> 
> 
> 

-- 
Dr Loïc d'Anterroches
Founder Céondo Ltd

w: www.ceondo.com       |  e: loic@ceondo.com
t: +44 (0)207 183 0016  |  f: +44 (0)207 183 0124

Céondo Ltd
Dalton House
60 Windsor Avenue
London
SW19 2RR / United Kingdom