multi line bash commands in a Makefile

2011-04-10 Thread ali hagigat
How can i specify a multi line shell instruction as a recipe? The
following returns an error:

makefile27:
e14:
@echo var1=$(var1)

makefile25:
include makefile27
e12:
@echo insidee12
makefile27: e13
if ( test $$count -eq 0) then echo "all: ;echo ppp" > 
makefile27;count=1;fi
e13: ;

make -f makefile25
if ( test $count -eq 0) then echo "all: ;echo ppp" > makefile27;count=1;fi
/bin/sh: line 0: test: -eq: unary operator expected
var1=

Why it complains about needing a unary operator?



Re: multi line bash commands in a Makefile

2011-04-10 Thread Clark J. Wang
On Sun, Apr 10, 2011 at 6:17 PM, ali hagigat  wrote:

> How can i specify a multi line shell instruction as a recipe? The
> following returns an error:
>
> makefile27:
> e14:
>@echo var1=$(var1)
>
> makefile25:
> include makefile27
> e12:
>@echo insidee12
> makefile27: e13
>if ( test $$count -eq 0) then echo "all: ;echo ppp" >
> makefile27;count=1;fi
>

When you test $count it's not assigned with a value yet.


> e13: ;
>
> make -f makefile25
> if ( test $count -eq 0) then echo "all: ;echo ppp" > makefile27;count=1;fi
> /bin/sh: line 0: test: -eq: unary operator expected
> var1=
>
> Why it complains about needing a unary operator?
>
>
-- 
Clark J. Wang


Re: multi line bash commands in a Makefile

2011-04-10 Thread ali hagigat
Thanks Clark for the reply. 'count' is set by shell before doing make. like
root> count=0

On Sun, Apr 10, 2011 at 3:10 PM, Clark J. Wang  wrote:
> On Sun, Apr 10, 2011 at 6:17 PM, ali hagigat  wrote:
>>
>> How can i specify a multi line shell instruction as a recipe? The
>> following returns an error:
>>
>> makefile27:
>> e14:
>>        @echo var1=$(var1)
>>
>> makefile25:
>> include makefile27
>> e12:
>>        @echo insidee12
>> makefile27: e13
>>        if ( test $$count -eq 0) then echo "all: ;echo ppp" >
>> makefile27;count=1;fi
>
> When you test $count it's not assigned with a value yet.
>
>>
>> e13: ;
>>
>> make -f makefile25
>> if ( test $count -eq 0) then echo "all: ;echo ppp" > makefile27;count=1;fi
>> /bin/sh: line 0: test: -eq: unary operator expected
>> var1=
>>
>> Why it complains about needing a unary operator?
>>
>
> --
> Clark J. Wang
>
>



Re: multi line bash commands in a Makefile

2011-04-10 Thread Sunny
> root> count=0

> 

You didn't export it.




Re: multi line bash commands in a Makefile

2011-04-10 Thread Clark J. Wang
On Sun, Apr 10, 2011 at 7:30 PM, ali hagigat  wrote:

> Thanks Clark for the reply. 'count' is set by shell before doing make. like
> root> count=0
>
>
Have you exported the 'count' var before invoking make?


>  On Sun, Apr 10, 2011 at 3:10 PM, Clark J. Wang 
> wrote:
> > On Sun, Apr 10, 2011 at 6:17 PM, ali hagigat 
> wrote:
> >>
> >> How can i specify a multi line shell instruction as a recipe? The
> >> following returns an error:
> >>
> >> makefile27:
> >> e14:
> >>@echo var1=$(var1)
> >>
> >> makefile25:
> >> include makefile27
> >> e12:
> >>@echo insidee12
> >> makefile27: e13
> >>if ( test $$count -eq 0) then echo "all: ;echo ppp" >
> >> makefile27;count=1;fi
> >
> > When you test $count it's not assigned with a value yet.
> >
> >>
> >> e13: ;
> >>
> >> make -f makefile25
> >> if ( test $count -eq 0) then echo "all: ;echo ppp" >
> makefile27;count=1;fi
> >> /bin/sh: line 0: test: -eq: unary operator expected
> >> var1=
> >>
> >> Why it complains about needing a unary operator?
> >>
> >
> > --
> > Clark J. Wang
> >
> >
>



-- 
Clark J. Wang


UTF8 conversion issues in bash-4.2

2011-04-10 Thread Allan McRae
I am seeing what appears to be some sort of UTF-8 conversion issue in 
bash-4.2.  I do not see this in bash 4.1.   I think the easiest way to 
describe this is:



> bash41 --version
GNU bash, version 4.1.9(2)-release (i686-pc-linux-gnu)

> LC_ALL=ru_RU.UTF-8 bash41 -c привет
bash: привет: command not found


> bash42 --version
GNU bash, version 4.2.8(2)-release (i686-pc-linux-gnu)

> LC_ALL=ru_RU.UTF-8 bash42 -c привет
bash: $'\320\277\321\200\320\270\320\262\320\265\321\202': команда не 
найдена


> LC_ALL=ru_RU.KOI8-R bash42 -c привет
bash: привет: ��� �� ��


I'm not sure what further information is needed here, so let me know if 
you need anything else to replicate this.


Allan