Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-28 Thread Arne Georg Gleditsch
Randy Dunlap <[EMAIL PROTECTED]> writes:
> On Tue, 26 Jun 2007 19:25:00 +0200 Julio M. Merino Vidal wrote:
>> The correct expression could be $((${a} + 2)).  Tested under NetBSD's  
>> sh, which is very POSIX-compliant.
>
> Thanks.  Does anyone see other changes that are needed?

[..]

> and the complete script is:

Both busybox sh and dash are happy with this.  (Or rather, busybox
would be if its mktemp hadn't been broken.)

-- 
Arne.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-28 Thread Arne Georg Gleditsch
Randy Dunlap [EMAIL PROTECTED] writes:
 On Tue, 26 Jun 2007 19:25:00 +0200 Julio M. Merino Vidal wrote:
 The correct expression could be $((${a} + 2)).  Tested under NetBSD's  
 sh, which is very POSIX-compliant.

 Thanks.  Does anyone see other changes that are needed?

[..]

 and the complete script is:

Both busybox sh and dash are happy with this.  (Or rather, busybox
would be if its mktemp hadn't been broken.)

-- 
Arne.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-26 Thread Randy Dunlap
On Tue, 26 Jun 2007 19:25:00 +0200 Julio M. Merino Vidal wrote:

> On 26/06/2007, at 19:19, Randy Dunlap wrote:
> >
> > Are these 2 line changes all that is needed?
> >
> > I sort of expected expressions like $((a + 2)) to need change also...
> > maybe not for dash, but for sh?
> 
> The correct expression could be $((${a} + 2)).  Tested under NetBSD's  
> sh, which is very POSIX-compliant.

Thanks.  Does anyone see other changes that are needed?


The diff currently looks like:

--- decodecode.~3~  2007-06-22 13:25:39.0 -0700
+++ decodecode  2007-06-26 10:40:28.0 -0700
@@ -28,7 +28,7 @@
 fi
 
 if [ $marker -ne 0 ]; then
-   beforemark=${code:0:$((marker - 1))}
+   beforemark=`echo "$code" | cut -c-$((${marker} - 1))`
echo -n "   .byte 0x" > $T.s
echo $beforemark | sed -e 's/ /,0x/g' >> $T.s
as -o $T.o $T.s
@@ -36,7 +36,7 @@
rm $T.o $T.s
 
 # and fix code at-and-after marker
-   code=${code:$marker}
+   code=`echo "$code" | cut -c$((${marker} + 1))-`
 fi
 
 code=`echo $code | sed -e 's/ [<(]/ /;s/[>)] / /;s/ /,0x/g'`




and the complete script is:

#!/bin/sh
# Disassemble the Code: line in Linux oopses
# usage: decodecode < oops.file

T=`mktemp`
code=

while read i ; do

case "$i" in
*Code:*)
code=$i
;;
esac

done

if [ -z "$code" ]; then
exit
fi

echo $code
code=`echo $code | sed -e 's/.*Code: //'`

marker=`expr index "$code" "\<"`
if [ $marker -eq 0 ]; then
marker=`expr index "$code" "\("`
fi

if [ $marker -ne 0 ]; then
beforemark=`echo "$code" | cut -c-$((${marker} - 1))`
echo -n "   .byte 0x" > $T.s
echo $beforemark | sed -e 's/ /,0x/g' >> $T.s
as -o $T.o $T.s
objdump -S $T.o
rm $T.o $T.s

# and fix code at-and-after marker
code=`echo "$code" | cut -c$((${marker} + 1))-`
fi

code=`echo $code | sed -e 's/ [<(]/ /;s/[>)] / /;s/ /,0x/g'`
echo -n "   .byte 0x" > $T.s
echo $code >> $T.s
as -o $T.o $T.s
objdump -S $T.o
rm $T.o $T.s
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-26 Thread Julio M. Merino Vidal

On 26/06/2007, at 19:19, Randy Dunlap wrote:


Are these 2 line changes all that is needed?

I sort of expected expressions like $((a + 2)) to need change also...
maybe not for dash, but for sh?


The correct expression could be $((${a} + 2)).  Tested under NetBSD's  
sh, which is very POSIX-compliant.


--
Julio M. Merino Vidal <[EMAIL PROTECTED]>


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-26 Thread Randy Dunlap
On Tue, 26 Jun 2007 12:50:27 +0200 Arne Georg Gleditsch wrote:

> Randy Dunlap <[EMAIL PROTECTED]> writes:
> > OTOH, you also didn't supply a patch.  If you do this, I'll be
> > glad to consider it.  If I can read it, that is.
> 
> I like bash as much as the next guy, but (to my surprise) /bin/sh on
> my current workstation is actually dash.  How about just replacing the
> substring-interpolations with:
> 
> if [ $marker -ne 0 ]; then
>   beforemark=`echo "$code" | cut -c-$((marker - 1))`
> [..]
> # and fix code at-and-after marker
>   code=`echo "$code" | cut -c$marker-`
> fi
> 
> and be done with it?


Are these 2 line changes all that is needed?

I sort of expected expressions like $((a + 2)) to need change also...
maybe not for dash, but for sh?

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-26 Thread DervishD
Hi Randy :)

 * Randy Dunlap <[EMAIL PROTECTED]> dixit:
> On Tue, 26 Jun 2007 17:33:59 +0200 DervishD wrote:
> >  * Jan-Benedict Glaw <[EMAIL PROTECTED]> dixit:
> > > On Tue, 2007-06-26 12:16:39 +0200, DervishD <[EMAIL PROTECTED]> wrote:
> > > > Given that it happens too with "ldd", it really *is* that hard. I
> > > > don't know why still people think that /bin/sh is always /bin/bash. If
> > > > they want/need bash, that's ok to me, I will have it installed for such
> > > > tasks, but they should call it "#!/bin/bash".
> > > 
> > > ...or "#!/usr/bin/env bash" for what it's worth...  The same for plain
> > > `sh'.
> > 
> > The "env" solution is a bit of a problem, too. Not always "env" is
> > installed in /usr/bin, but in /bin, so it is available even if /usr is
> > not still mounted. But /bin/sh is pretty standard (as it should be
> > /bin/bash, anyway), and it's only two chars shorter than the correct
> > "/bin/bash". No idea why it is not fixed.
> 
> because nobody sent a patch yet?
> 
> but I'll get around tuit.

Sorry, I wasn't speaking about your patch, I was talking about the
"ldd" issue (and others like that). When I was preparing the patch for
"ldd" I saw in a mailing list archive the answer given to somebody that
tried exactly the same and I lost all interest in patching "ldd".

Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
It's my PC and I'll cry if I want to... RAmen!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-26 Thread Randy Dunlap
On Tue, 26 Jun 2007 17:33:59 +0200 DervishD wrote:

> Hi Jan :)
> 
>  * Jan-Benedict Glaw <[EMAIL PROTECTED]> dixit:
> > On Tue, 2007-06-26 12:16:39 +0200, DervishD <[EMAIL PROTECTED]> wrote:
> > > Given that it happens too with "ldd", it really *is* that hard. I
> > > don't know why still people think that /bin/sh is always /bin/bash. If
> > > they want/need bash, that's ok to me, I will have it installed for such
> > > tasks, but they should call it "#!/bin/bash".
> > 
> > ...or "#!/usr/bin/env bash" for what it's worth...  The same for plain
> > `sh'.
> 
> The "env" solution is a bit of a problem, too. Not always "env" is
> installed in /usr/bin, but in /bin, so it is available even if /usr is
> not still mounted. But /bin/sh is pretty standard (as it should be
> /bin/bash, anyway), and it's only two chars shorter than the correct
> "/bin/bash". No idea why it is not fixed.

because nobody sent a patch yet?

but I'll get around tuit.

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-26 Thread DervishD
Hi Arne :)

 * Arne Georg Gleditsch <[EMAIL PROTECTED]> dixit:
> Randy Dunlap <[EMAIL PROTECTED]> writes:
> > OTOH, you also didn't supply a patch.  If you do this, I'll be
> > glad to consider it.  If I can read it, that is.
> 
> I like bash as much as the next guy, but (to my surprise) /bin/sh on
> my current workstation is actually dash.

You're probably using Ubuntu, am I right? I have a do-it-yourself
Linux box and my /bin/sh is dash. It is POSIX compliant, small and
lightning fast. I use as a reference shell. I have installed zsh and
bash, too, and sometimes I have to relink /bin/sh to point to /bin/bash
so certain scripts work...

Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
It's my PC and I'll cry if I want to... RAmen!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-26 Thread DervishD
Hi Jan :)

 * Jan-Benedict Glaw <[EMAIL PROTECTED]> dixit:
> On Tue, 2007-06-26 12:16:39 +0200, DervishD <[EMAIL PROTECTED]> wrote:
> > Given that it happens too with "ldd", it really *is* that hard. I
> > don't know why still people think that /bin/sh is always /bin/bash. If
> > they want/need bash, that's ok to me, I will have it installed for such
> > tasks, but they should call it "#!/bin/bash".
> 
> ...or "#!/usr/bin/env bash" for what it's worth...  The same for plain
> `sh'.

The "env" solution is a bit of a problem, too. Not always "env" is
installed in /usr/bin, but in /bin, so it is available even if /usr is
not still mounted. But /bin/sh is pretty standard (as it should be
/bin/bash, anyway), and it's only two chars shorter than the correct
"/bin/bash". No idea why it is not fixed.

Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
It's my PC and I'll cry if I want to... RAmen!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-26 Thread Arne Georg Gleditsch
Randy Dunlap <[EMAIL PROTECTED]> writes:
> OTOH, you also didn't supply a patch.  If you do this, I'll be
> glad to consider it.  If I can read it, that is.

I like bash as much as the next guy, but (to my surprise) /bin/sh on
my current workstation is actually dash.  How about just replacing the
substring-interpolations with:

if [ $marker -ne 0 ]; then
beforemark=`echo "$code" | cut -c-$((marker - 1))`
[..]
# and fix code at-and-after marker
code=`echo "$code" | cut -c$marker-`
fi

and be done with it?

-- 
Arne.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-26 Thread Jan-Benedict Glaw
On Tue, 2007-06-26 12:16:39 +0200, DervishD <[EMAIL PROTECTED]> wrote:
>  * Matthieu CASTET <[EMAIL PROTECTED]> dixit:
> > On Sat, 23 Jun 2007 10:43:03 -0700, Randy Dunlap wrote:
> > 
> > > OTOH, you also didn't supply a patch.  If you do this, I'll be glad to
> > > consider it.  If I can read it, that is.
> > 
> > "s|/bin/sh|/bin/bash" is so hard to do ?
> 
> Given that it happens too with "ldd", it really *is* that hard. I
> don't know why still people think that /bin/sh is always /bin/bash. If
> they want/need bash, that's ok to me, I will have it installed for such
> tasks, but they should call it "#!/bin/bash".

...or "#!/usr/bin/env bash" for what it's worth...  The same for plain
`sh'.

MfG, JBG

-- 
  Jan-Benedict Glaw  [EMAIL PROTECTED]  +49-172-7608481
 Signature of:  http://perl.plover.com/Questions.html
 the second  :


signature.asc
Description: Digital signature


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-26 Thread DervishD
Hi Matthieu :)

 * Matthieu CASTET <[EMAIL PROTECTED]> dixit:
> On Sat, 23 Jun 2007 10:43:03 -0700, Randy Dunlap wrote:
> 
> > OTOH, you also didn't supply a patch.  If you do this, I'll be glad to
> > consider it.  If I can read it, that is.
> 
> "s|/bin/sh|/bin/bash" is so hard to do ?

Given that it happens too with "ldd", it really *is* that hard. I
don't know why still people think that /bin/sh is always /bin/bash. If
they want/need bash, that's ok to me, I will have it installed for such
tasks, but they should call it "#!/bin/bash".

It seems easier to say "get a real shell" (as if Bash was the only
real shell) than fixing that bug...

Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
It's my PC and I'll cry if I want to... RAmen!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-26 Thread DervishD
Hi Matthieu :)

 * Matthieu CASTET [EMAIL PROTECTED] dixit:
 On Sat, 23 Jun 2007 10:43:03 -0700, Randy Dunlap wrote:
 
  OTOH, you also didn't supply a patch.  If you do this, I'll be glad to
  consider it.  If I can read it, that is.
 
 s|/bin/sh|/bin/bash is so hard to do ?

Given that it happens too with ldd, it really *is* that hard. I
don't know why still people think that /bin/sh is always /bin/bash. If
they want/need bash, that's ok to me, I will have it installed for such
tasks, but they should call it #!/bin/bash.

It seems easier to say get a real shell (as if Bash was the only
real shell) than fixing that bug...

Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
It's my PC and I'll cry if I want to... RAmen!
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-26 Thread Jan-Benedict Glaw
On Tue, 2007-06-26 12:16:39 +0200, DervishD [EMAIL PROTECTED] wrote:
  * Matthieu CASTET [EMAIL PROTECTED] dixit:
  On Sat, 23 Jun 2007 10:43:03 -0700, Randy Dunlap wrote:
  
   OTOH, you also didn't supply a patch.  If you do this, I'll be glad to
   consider it.  If I can read it, that is.
  
  s|/bin/sh|/bin/bash is so hard to do ?
 
 Given that it happens too with ldd, it really *is* that hard. I
 don't know why still people think that /bin/sh is always /bin/bash. If
 they want/need bash, that's ok to me, I will have it installed for such
 tasks, but they should call it #!/bin/bash.

...or #!/usr/bin/env bash for what it's worth...  The same for plain
`sh'.

MfG, JBG

-- 
  Jan-Benedict Glaw  [EMAIL PROTECTED]  +49-172-7608481
 Signature of:  http://perl.plover.com/Questions.html
 the second  :


signature.asc
Description: Digital signature


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-26 Thread Arne Georg Gleditsch
Randy Dunlap [EMAIL PROTECTED] writes:
 OTOH, you also didn't supply a patch.  If you do this, I'll be
 glad to consider it.  If I can read it, that is.

I like bash as much as the next guy, but (to my surprise) /bin/sh on
my current workstation is actually dash.  How about just replacing the
substring-interpolations with:

if [ $marker -ne 0 ]; then
beforemark=`echo $code | cut -c-$((marker - 1))`
[..]
# and fix code at-and-after marker
code=`echo $code | cut -c$marker-`
fi

and be done with it?

-- 
Arne.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-26 Thread DervishD
Hi Jan :)

 * Jan-Benedict Glaw [EMAIL PROTECTED] dixit:
 On Tue, 2007-06-26 12:16:39 +0200, DervishD [EMAIL PROTECTED] wrote:
  Given that it happens too with ldd, it really *is* that hard. I
  don't know why still people think that /bin/sh is always /bin/bash. If
  they want/need bash, that's ok to me, I will have it installed for such
  tasks, but they should call it #!/bin/bash.
 
 ...or #!/usr/bin/env bash for what it's worth...  The same for plain
 `sh'.

The env solution is a bit of a problem, too. Not always env is
installed in /usr/bin, but in /bin, so it is available even if /usr is
not still mounted. But /bin/sh is pretty standard (as it should be
/bin/bash, anyway), and it's only two chars shorter than the correct
/bin/bash. No idea why it is not fixed.

Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
It's my PC and I'll cry if I want to... RAmen!
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-26 Thread DervishD
Hi Arne :)

 * Arne Georg Gleditsch [EMAIL PROTECTED] dixit:
 Randy Dunlap [EMAIL PROTECTED] writes:
  OTOH, you also didn't supply a patch.  If you do this, I'll be
  glad to consider it.  If I can read it, that is.
 
 I like bash as much as the next guy, but (to my surprise) /bin/sh on
 my current workstation is actually dash.

You're probably using Ubuntu, am I right? I have a do-it-yourself
Linux box and my /bin/sh is dash. It is POSIX compliant, small and
lightning fast. I use as a reference shell. I have installed zsh and
bash, too, and sometimes I have to relink /bin/sh to point to /bin/bash
so certain scripts work...

Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
It's my PC and I'll cry if I want to... RAmen!
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-26 Thread Randy Dunlap
On Tue, 26 Jun 2007 17:33:59 +0200 DervishD wrote:

 Hi Jan :)
 
  * Jan-Benedict Glaw [EMAIL PROTECTED] dixit:
  On Tue, 2007-06-26 12:16:39 +0200, DervishD [EMAIL PROTECTED] wrote:
   Given that it happens too with ldd, it really *is* that hard. I
   don't know why still people think that /bin/sh is always /bin/bash. If
   they want/need bash, that's ok to me, I will have it installed for such
   tasks, but they should call it #!/bin/bash.
  
  ...or #!/usr/bin/env bash for what it's worth...  The same for plain
  `sh'.
 
 The env solution is a bit of a problem, too. Not always env is
 installed in /usr/bin, but in /bin, so it is available even if /usr is
 not still mounted. But /bin/sh is pretty standard (as it should be
 /bin/bash, anyway), and it's only two chars shorter than the correct
 /bin/bash. No idea why it is not fixed.

because nobody sent a patch yet?

but I'll get around tuit.

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-26 Thread DervishD
Hi Randy :)

 * Randy Dunlap [EMAIL PROTECTED] dixit:
 On Tue, 26 Jun 2007 17:33:59 +0200 DervishD wrote:
   * Jan-Benedict Glaw [EMAIL PROTECTED] dixit:
   On Tue, 2007-06-26 12:16:39 +0200, DervishD [EMAIL PROTECTED] wrote:
Given that it happens too with ldd, it really *is* that hard. I
don't know why still people think that /bin/sh is always /bin/bash. If
they want/need bash, that's ok to me, I will have it installed for such
tasks, but they should call it #!/bin/bash.
   
   ...or #!/usr/bin/env bash for what it's worth...  The same for plain
   `sh'.
  
  The env solution is a bit of a problem, too. Not always env is
  installed in /usr/bin, but in /bin, so it is available even if /usr is
  not still mounted. But /bin/sh is pretty standard (as it should be
  /bin/bash, anyway), and it's only two chars shorter than the correct
  /bin/bash. No idea why it is not fixed.
 
 because nobody sent a patch yet?
 
 but I'll get around tuit.

Sorry, I wasn't speaking about your patch, I was talking about the
ldd issue (and others like that). When I was preparing the patch for
ldd I saw in a mailing list archive the answer given to somebody that
tried exactly the same and I lost all interest in patching ldd.

Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
It's my PC and I'll cry if I want to... RAmen!
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-26 Thread Randy Dunlap
On Tue, 26 Jun 2007 12:50:27 +0200 Arne Georg Gleditsch wrote:

 Randy Dunlap [EMAIL PROTECTED] writes:
  OTOH, you also didn't supply a patch.  If you do this, I'll be
  glad to consider it.  If I can read it, that is.
 
 I like bash as much as the next guy, but (to my surprise) /bin/sh on
 my current workstation is actually dash.  How about just replacing the
 substring-interpolations with:
 
 if [ $marker -ne 0 ]; then
   beforemark=`echo $code | cut -c-$((marker - 1))`
 [..]
 # and fix code at-and-after marker
   code=`echo $code | cut -c$marker-`
 fi
 
 and be done with it?


Are these 2 line changes all that is needed?

I sort of expected expressions like $((a + 2)) to need change also...
maybe not for dash, but for sh?

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-26 Thread Julio M. Merino Vidal

On 26/06/2007, at 19:19, Randy Dunlap wrote:


Are these 2 line changes all that is needed?

I sort of expected expressions like $((a + 2)) to need change also...
maybe not for dash, but for sh?


The correct expression could be $((${a} + 2)).  Tested under NetBSD's  
sh, which is very POSIX-compliant.


--
Julio M. Merino Vidal [EMAIL PROTECTED]


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-26 Thread Randy Dunlap
On Tue, 26 Jun 2007 19:25:00 +0200 Julio M. Merino Vidal wrote:

 On 26/06/2007, at 19:19, Randy Dunlap wrote:
 
  Are these 2 line changes all that is needed?
 
  I sort of expected expressions like $((a + 2)) to need change also...
  maybe not for dash, but for sh?
 
 The correct expression could be $((${a} + 2)).  Tested under NetBSD's  
 sh, which is very POSIX-compliant.

Thanks.  Does anyone see other changes that are needed?


The diff currently looks like:

--- decodecode.~3~  2007-06-22 13:25:39.0 -0700
+++ decodecode  2007-06-26 10:40:28.0 -0700
@@ -28,7 +28,7 @@
 fi
 
 if [ $marker -ne 0 ]; then
-   beforemark=${code:0:$((marker - 1))}
+   beforemark=`echo $code | cut -c-$((${marker} - 1))`
echo -n.byte 0x  $T.s
echo $beforemark | sed -e 's/ /,0x/g'  $T.s
as -o $T.o $T.s
@@ -36,7 +36,7 @@
rm $T.o $T.s
 
 # and fix code at-and-after marker
-   code=${code:$marker}
+   code=`echo $code | cut -c$((${marker} + 1))-`
 fi
 
 code=`echo $code | sed -e 's/ [(]/ /;s/[)] / /;s/ /,0x/g'`




and the complete script is:

#!/bin/sh
# Disassemble the Code: line in Linux oopses
# usage: decodecode  oops.file

T=`mktemp`
code=

while read i ; do

case $i in
*Code:*)
code=$i
;;
esac

done

if [ -z $code ]; then
exit
fi

echo $code
code=`echo $code | sed -e 's/.*Code: //'`

marker=`expr index $code \`
if [ $marker -eq 0 ]; then
marker=`expr index $code \(`
fi

if [ $marker -ne 0 ]; then
beforemark=`echo $code | cut -c-$((${marker} - 1))`
echo -n.byte 0x  $T.s
echo $beforemark | sed -e 's/ /,0x/g'  $T.s
as -o $T.o $T.s
objdump -S $T.o
rm $T.o $T.s

# and fix code at-and-after marker
code=`echo $code | cut -c$((${marker} + 1))-`
fi

code=`echo $code | sed -e 's/ [(]/ /;s/[)] / /;s/ /,0x/g'`
echo -n.byte 0x  $T.s
echo $code  $T.s
as -o $T.o $T.s
objdump -S $T.o
rm $T.o $T.s
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Randy Dunlap

Adrian Bunk wrote:

On Sat, Jun 23, 2007 at 10:56:45AM -0700, Andrew Morton wrote:

On Sat, 23 Jun 2007 10:43:03 -0700 Randy Dunlap <[EMAIL PROTECTED]> wrote:


NAK.

Sorry I slept thru another wonderful festival on LKML.

That's probably the best strategy.


You don't have the authority to NAK the patch.

Yeah.  nak to naks.


OTOH, you also didn't supply a patch.  If you do this, I'll be
glad to consider it.  If I can read it, that is.

Yes, I plan on merging that patch as-is.  If it was a compulsory part of
kbuild then that would be a problem but as some optional tool I don't think
that a bashism matters much.  Someone can fix it sometime should they feel
so motivated.


Oleg didn't express it very polite, but he has a valid point that bash 
scripts should start with "#!/bin/bash" since /bin/sh might be some 
shell other than bash.


Randy, am I right to assume that such a change to your patch would be OK?


Sure.

--
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Adrian Bunk
On Sat, Jun 23, 2007 at 10:56:45AM -0700, Andrew Morton wrote:
> On Sat, 23 Jun 2007 10:43:03 -0700 Randy Dunlap <[EMAIL PROTECTED]> wrote:
> 
> > > NAK.
> > 
> > Sorry I slept thru another wonderful festival on LKML.
> 
> That's probably the best strategy.
> 
> > You don't have the authority to NAK the patch.
> 
> Yeah.  nak to naks.
> 
> > OTOH, you also didn't supply a patch.  If you do this, I'll be
> > glad to consider it.  If I can read it, that is.
> 
> Yes, I plan on merging that patch as-is.  If it was a compulsory part of
> kbuild then that would be a problem but as some optional tool I don't think
> that a bashism matters much.  Someone can fix it sometime should they feel
> so motivated.

Oleg didn't express it very polite, but he has a valid point that bash 
scripts should start with "#!/bin/bash" since /bin/sh might be some 
shell other than bash.

Randy, am I right to assume that such a change to your patch would be OK?

cu
Adrian

-- 

   "Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
   "Only a promise," Lao Er said.
   Pearl S. Buck - Dragon Seed

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Matthieu CASTET
Hi,

On Sat, 23 Jun 2007 10:43:03 -0700, Randy Dunlap wrote:

> OTOH, you also didn't supply a patch.  If you do this, I'll be glad to
> consider it.  If I can read it, that is.

"s|/bin/sh|/bin/bash" is so hard to do ?

Matthieu

PS : this remind me http://www.landley.net/code/firmware/ . Is it so 
difficult to understand that sh is not bash. It is like assuming that 
everybody as a "qwerty" keyboard.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Andrew Morton
On Sat, 23 Jun 2007 10:43:03 -0700 Randy Dunlap <[EMAIL PROTECTED]> wrote:

> > NAK.
> 
> Sorry I slept thru another wonderful festival on LKML.

That's probably the best strategy.

> You don't have the authority to NAK the patch.

Yeah.  nak to naks.

> OTOH, you also didn't supply a patch.  If you do this, I'll be
> glad to consider it.  If I can read it, that is.

Yes, I plan on merging that patch as-is.  If it was a compulsory part of
kbuild then that would be a problem but as some optional tool I don't think
that a bashism matters much.  Someone can fix it sometime should they feel
so motivated.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Randy Dunlap
On Sat, 23 Jun 2007 10:34:59 +0200 Oleg Verych wrote:

> * From: Randy Dunlap
> * Newsgroups: linux.kernel
> * Date: Fri, 22 Jun 2007 13:28:10 -0700
> * Organization: Oracle Linux Eng.
> 
> []
> > --- /dev/null
> > +++ linux-2.6.22-rc5/scripts/decodecode
> > @@ -0,0 +1,47 @@
> > +#!/bin/sh
> > +# Disassemble the Code: line in Linux oopses
> > +# usage: decodecode < oops.file
> 
> |-*- sh = dash -*-
> flower:-$  Jun 18 22:05:11 localhost kernel: Code: 00 00 00 eb 1b 6b 4e 38 05 89 ca 03 
> 53 \
> 1c 4a 89 d0 31 d2 f7 f1 89 da 89 c1 89 f0 e8 83 ed ff ff e8 26 af 12 00 8b 76 
> 6\
> 4 83 ee 64 <8b> 46 64 0f 18 00 90 81 fe 14 5c 37 c0 0f 85 70 ff ff ff b8 84
> decodecode: 31: Syntax error: Bad substitution
> flower:-$
> |-*-
> 
> Or you are writing for "#!/bin/bash", or i can help optimize and make
> this script "sh" compatible.
> 
> NAK.

Sorry I slept thru another wonderful festival on LKML.

You don't have the authority to NAK the patch.

OTOH, you also didn't supply a patch.  If you do this, I'll be
glad to consider it.  If I can read it, that is.


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Segher Boessenkool

Having the scripts work with other shells is very helpful for porting,
cross building and the like.


I think it is fair game to require bash to build the
kernel -- after all, GCC and GNU make are required
already, and bash has many helpful features that not
every POSIX shell has.


Also on Linux /bin/sh is not neccessarily /bin/bash.


Yes, it would be ridiculous to require /bin/sh to be
bash.  Especially since bash is installed as /bin/bash
always :-)


Segher

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Oleg Verych
On Sat, Jun 23, 2007 at 03:17:27PM +0200, Andi Kleen wrote:
> On Saturday 23 June 2007 13:09, Arkadiusz Miskiewicz wrote:
> > On Saturday 23 of June 2007, Andi Kleen wrote:
> > > Here's a nickel. Get yourself a real shell.
> >
> > POSIX compilant shell isn't real shell?
> 
> In this case it's not good enough. We're not writing POSIX portable software 
> here, but Linux software where /bin/sh is /bin/bash. Similar to the Linux 
> kernel which is not written in portable ISO C.

Technical reply about my disagreement.

It's a problem more like "it's broken, but somebody use this in the
source tree". Good example is if "someone uses page_mapping on a slab
page" and have oops with SLUB:

Message-ID: <[EMAIL PROTECTED]>
Archived-At: 

Thus, if one doesn't know what `#!/bin/sh' really is, don't
"syntax error" with possible another sh[ell]. In the Linux build system
$(CONFIG_SHELL) currently is bash, but that's only in the kbuild *now*.

Hope that clarifies.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Alan Cox
On Sat, 23 Jun 2007 16:34:42 +0200
Andi Kleen <[EMAIL PROTECTED]> wrote:

> On Saturday 23 June 2007 16:32:39 Alan Cox wrote:
>  
> > Having the scripts work with other shells is very helpful for porting,
> > cross building and the like.
> 
> Well then for the majority of cross compile users you should consequently 
> write 
> them in Windows batch language.

That isn't portable or standardised. And there are posix shells for
Windows if you really want to cross build on Windows (and some folks do
for embedded because of debug/ice enviroments - pity them)

> > Also on Linux /bin/sh is not 
> > neccessarily /bin/bash.
> 
> If it's not I think these few distributions give Linux a bad name 
> because they introduce quite unnecessary incompatibilities.
> Hopefully they are not widely used.

On the contrary, it is you who is causing incompatibilities by objecting
to the use of standards compliant behaviour. This is the world according
to the standards not the world according to Andi Kleen. (Which one would
run better is a different debate to which one we live in ;))
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Sean
On Sat, 23 Jun 2007 15:17:27 +0200
Andi Kleen <[EMAIL PROTECTED]> wrote:

> In this case it's not good enough. We're not writing POSIX portable software 
> here, but Linux software where /bin/sh is /bin/bash. Similar to the Linux 
> kernel which is not written in portable ISO C.

There's no rule that says /bin/sh is always /bin/bash.  What Novell
distributions do does not translate to all of "Linux".  If you are writing
scripts that rely on bash then "#!/bin/bash" is the appropriate way to
document that and give it the best chance of working portably.

Sean
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Andi Kleen
On Saturday 23 June 2007 16:32:39 Alan Cox wrote:
 
> Having the scripts work with other shells is very helpful for porting,
> cross building and the like.

Well then for the majority of cross compile users you should consequently write 
them in Windows batch language.

> Also on Linux /bin/sh is not 
> neccessarily /bin/bash.

If it's not I think these few distributions give Linux a bad name 
because they introduce quite unnecessary incompatibilities.
Hopefully they are not widely used.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Alan Cox
On Sat, 23 Jun 2007 15:17:27 +0200
Andi Kleen <[EMAIL PROTECTED]> wrote:

> On Saturday 23 June 2007 13:09, Arkadiusz Miskiewicz wrote:
> > On Saturday 23 of June 2007, Andi Kleen wrote:
> > > Here's a nickel. Get yourself a real shell.
> >
> > POSIX compilant shell isn't real shell?
> 
> In this case it's not good enough. We're not writing POSIX portable software 
> here, but Linux software where /bin/sh is /bin/bash. Similar to the Linux 
> kernel which is not written in portable ISO C.

Having the scripts work with other shells is very helpful for porting,
cross building and the like. Also on Linux /bin/sh is not
neccessarily /bin/bash.

Alan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Arkadiusz Miskiewicz
On Saturday 23 of June 2007, Andi Kleen wrote:
> On Saturday 23 June 2007 13:09, Arkadiusz Miskiewicz wrote:
> > On Saturday 23 of June 2007, Andi Kleen wrote:
> > > Here's a nickel. Get yourself a real shell.
> >
> > POSIX compilant shell isn't real shell?
>
> In this case it's not good enough. We're not writing POSIX portable
> software here, but Linux software where /bin/sh is /bin/bash.

Here on my Linux software /bin/sh is pdksh and bash installation is 
*optional*.

Is it so hard to tell truth in first line of shell script, tha it NEEDS 
exactly bash (#!/bin/bash) ?

> -Andi

-- 
Arkadiusz MiśkiewiczPLD/Linux Team
arekm / maven.plhttp://ftp.pld-linux.org/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Björn Steinbrink
On 2007.06.23 15:17:27 +0200, Andi Kleen wrote:
> On Saturday 23 June 2007 13:09, Arkadiusz Miskiewicz wrote:
> > On Saturday 23 of June 2007, Andi Kleen wrote:
> > > Here's a nickel. Get yourself a real shell.
> >
> > POSIX compilant shell isn't real shell?
> 
> In this case it's not good enough. We're not writing POSIX portable software 
> here, but Linux software where /bin/sh is /bin/bash. Similar to the Linux 
> kernel which is not written in portable ISO C.

At least LSB 3.1 doesn't require /bin/sh to be /bin/bash. And if you
want bash, what's the problem with just writing #!/bin/bash instead of
#!/bin/sh?


Björn
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[OT]Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Oleg Verych
On Sat, Jun 23, 2007 at 03:26:26PM +0200, Willy Tarreau wrote:
> On Sat, Jun 23, 2007 at 03:17:27PM +0200, Andi Kleen wrote:
> > On Saturday 23 June 2007 13:09, Arkadiusz Miskiewicz wrote:
> > > On Saturday 23 of June 2007, Andi Kleen wrote:
> > > > Here's a nickel. Get yourself a real shell.
> > >
> > > POSIX compilant shell isn't real shell?
> > 
> > In this case it's not good enough. We're not writing POSIX portable 
> > software 
> > here, but Linux software where /bin/sh is /bin/bash. Similar to the Linux 
> > kernel which is not written in portable ISO C.

I disagree.

> Well, it can also be zsh or pdksh, but I suspect that the code is valid on
> them too.

Not for the latter:
|-*- pdksh -*-
flower:-$ /dev/null pdksh decodecode
decodecode[40]: : bad substitution
flower:-$
|-*-

I don't want to go further with this OT, just last thing.

It's GNU BaSH *BUG* (addition to being big and slow), if it can't switch
off it's expressly undocumented extentions while run as `/bin/sh'.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Willy Tarreau
On Sat, Jun 23, 2007 at 03:17:27PM +0200, Andi Kleen wrote:
> On Saturday 23 June 2007 13:09, Arkadiusz Miskiewicz wrote:
> > On Saturday 23 of June 2007, Andi Kleen wrote:
> > > Here's a nickel. Get yourself a real shell.
> >
> > POSIX compilant shell isn't real shell?
> 
> In this case it's not good enough. We're not writing POSIX portable software 
> here, but Linux software where /bin/sh is /bin/bash. Similar to the Linux 
> kernel which is not written in portable ISO C.

Well, it can also be zsh or pdksh, but I suspect that the code is valid on
them too.

Willy

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Andi Kleen
On Saturday 23 June 2007 13:09, Arkadiusz Miskiewicz wrote:
> On Saturday 23 of June 2007, Andi Kleen wrote:
> > Here's a nickel. Get yourself a real shell.
>
> POSIX compilant shell isn't real shell?

In this case it's not good enough. We're not writing POSIX portable software 
here, but Linux software where /bin/sh is /bin/bash. Similar to the Linux 
kernel which is not written in portable ISO C.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Arkadiusz Miskiewicz
On Saturday 23 of June 2007, Andi Kleen wrote:
> Here's a nickel. Get yourself a real shell.

POSIX compilant shell isn't real shell?

> -Andi

-- 
Arkadiusz MiśkiewiczPLD/Linux Team
arekm / maven.plhttp://ftp.pld-linux.org/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Andi Kleen

Here's a nickel. Get yourself a real shell.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Arkadiusz Miskiewicz
On Saturday 23 of June 2007, Andi Kleen wrote:
 Here's a nickel. Get yourself a real shell.

POSIX compilant shell isn't real shell?

 -Andi

-- 
Arkadiusz MiśkiewiczPLD/Linux Team
arekm / maven.plhttp://ftp.pld-linux.org/
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Andi Kleen

Here's a nickel. Get yourself a real shell.

-Andi
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Andi Kleen
On Saturday 23 June 2007 13:09, Arkadiusz Miskiewicz wrote:
 On Saturday 23 of June 2007, Andi Kleen wrote:
  Here's a nickel. Get yourself a real shell.

 POSIX compilant shell isn't real shell?

In this case it's not good enough. We're not writing POSIX portable software 
here, but Linux software where /bin/sh is /bin/bash. Similar to the Linux 
kernel which is not written in portable ISO C.

-Andi
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Willy Tarreau
On Sat, Jun 23, 2007 at 03:17:27PM +0200, Andi Kleen wrote:
 On Saturday 23 June 2007 13:09, Arkadiusz Miskiewicz wrote:
  On Saturday 23 of June 2007, Andi Kleen wrote:
   Here's a nickel. Get yourself a real shell.
 
  POSIX compilant shell isn't real shell?
 
 In this case it's not good enough. We're not writing POSIX portable software 
 here, but Linux software where /bin/sh is /bin/bash. Similar to the Linux 
 kernel which is not written in portable ISO C.

Well, it can also be zsh or pdksh, but I suspect that the code is valid on
them too.

Willy

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[OT]Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Oleg Verych
On Sat, Jun 23, 2007 at 03:26:26PM +0200, Willy Tarreau wrote:
 On Sat, Jun 23, 2007 at 03:17:27PM +0200, Andi Kleen wrote:
  On Saturday 23 June 2007 13:09, Arkadiusz Miskiewicz wrote:
   On Saturday 23 of June 2007, Andi Kleen wrote:
Here's a nickel. Get yourself a real shell.
  
   POSIX compilant shell isn't real shell?
  
  In this case it's not good enough. We're not writing POSIX portable 
  software 
  here, but Linux software where /bin/sh is /bin/bash. Similar to the Linux 
  kernel which is not written in portable ISO C.

I disagree.

 Well, it can also be zsh or pdksh, but I suspect that the code is valid on
 them too.

Not for the latter:
|-*- pdksh -*-
flower:-$ kernelOops.txt/dev/null pdksh decodecode
decodecode[40]: : bad substitution
flower:-$
|-*-

I don't want to go further with this OT, just last thing.

It's GNU BaSH *BUG* (addition to being big and slow), if it can't switch
off it's expressly undocumented extentions while run as `/bin/sh'.

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Alan Cox
On Sat, 23 Jun 2007 15:17:27 +0200
Andi Kleen [EMAIL PROTECTED] wrote:

 On Saturday 23 June 2007 13:09, Arkadiusz Miskiewicz wrote:
  On Saturday 23 of June 2007, Andi Kleen wrote:
   Here's a nickel. Get yourself a real shell.
 
  POSIX compilant shell isn't real shell?
 
 In this case it's not good enough. We're not writing POSIX portable software 
 here, but Linux software where /bin/sh is /bin/bash. Similar to the Linux 
 kernel which is not written in portable ISO C.

Having the scripts work with other shells is very helpful for porting,
cross building and the like. Also on Linux /bin/sh is not
neccessarily /bin/bash.

Alan
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Oleg Verych
On Sat, Jun 23, 2007 at 03:17:27PM +0200, Andi Kleen wrote:
 On Saturday 23 June 2007 13:09, Arkadiusz Miskiewicz wrote:
  On Saturday 23 of June 2007, Andi Kleen wrote:
   Here's a nickel. Get yourself a real shell.
 
  POSIX compilant shell isn't real shell?
 
 In this case it's not good enough. We're not writing POSIX portable software 
 here, but Linux software where /bin/sh is /bin/bash. Similar to the Linux 
 kernel which is not written in portable ISO C.

Technical reply about my disagreement.

It's a problem more like it's broken, but somebody use this in the
source tree. Good example is if someone uses page_mapping on a slab
page and have oops with SLUB:

Message-ID: [EMAIL PROTECTED]
Archived-At: http://permalink.gmane.org/gmane.linux.kernel/546758

Thus, if one doesn't know what `#!/bin/sh' really is, don't
syntax error with possible another sh[ell]. In the Linux build system
$(CONFIG_SHELL) currently is bash, but that's only in the kbuild *now*.

Hope that clarifies.

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Arkadiusz Miskiewicz
On Saturday 23 of June 2007, Andi Kleen wrote:
 On Saturday 23 June 2007 13:09, Arkadiusz Miskiewicz wrote:
  On Saturday 23 of June 2007, Andi Kleen wrote:
   Here's a nickel. Get yourself a real shell.
 
  POSIX compilant shell isn't real shell?

 In this case it's not good enough. We're not writing POSIX portable
 software here, but Linux software where /bin/sh is /bin/bash.

Here on my Linux software /bin/sh is pdksh and bash installation is 
*optional*.

Is it so hard to tell truth in first line of shell script, tha it NEEDS 
exactly bash (#!/bin/bash) ?

 -Andi

-- 
Arkadiusz MiśkiewiczPLD/Linux Team
arekm / maven.plhttp://ftp.pld-linux.org/
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Segher Boessenkool

Having the scripts work with other shells is very helpful for porting,
cross building and the like.


I think it is fair game to require bash to build the
kernel -- after all, GCC and GNU make are required
already, and bash has many helpful features that not
every POSIX shell has.


Also on Linux /bin/sh is not neccessarily /bin/bash.


Yes, it would be ridiculous to require /bin/sh to be
bash.  Especially since bash is installed as /bin/bash
always :-)


Segher

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Björn Steinbrink
On 2007.06.23 15:17:27 +0200, Andi Kleen wrote:
 On Saturday 23 June 2007 13:09, Arkadiusz Miskiewicz wrote:
  On Saturday 23 of June 2007, Andi Kleen wrote:
   Here's a nickel. Get yourself a real shell.
 
  POSIX compilant shell isn't real shell?
 
 In this case it's not good enough. We're not writing POSIX portable software 
 here, but Linux software where /bin/sh is /bin/bash. Similar to the Linux 
 kernel which is not written in portable ISO C.

At least LSB 3.1 doesn't require /bin/sh to be /bin/bash. And if you
want bash, what's the problem with just writing #!/bin/bash instead of
#!/bin/sh?


Björn
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Alan Cox
On Sat, 23 Jun 2007 16:34:42 +0200
Andi Kleen [EMAIL PROTECTED] wrote:

 On Saturday 23 June 2007 16:32:39 Alan Cox wrote:
  
  Having the scripts work with other shells is very helpful for porting,
  cross building and the like.
 
 Well then for the majority of cross compile users you should consequently 
 write 
 them in Windows batch language.

That isn't portable or standardised. And there are posix shells for
Windows if you really want to cross build on Windows (and some folks do
for embedded because of debug/ice enviroments - pity them)

  Also on Linux /bin/sh is not 
  neccessarily /bin/bash.
 
 If it's not I think these few distributions give Linux a bad name 
 because they introduce quite unnecessary incompatibilities.
 Hopefully they are not widely used.

On the contrary, it is you who is causing incompatibilities by objecting
to the use of standards compliant behaviour. This is the world according
to the standards not the world according to Andi Kleen. (Which one would
run better is a different debate to which one we live in ;))
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Sean
On Sat, 23 Jun 2007 15:17:27 +0200
Andi Kleen [EMAIL PROTECTED] wrote:

 In this case it's not good enough. We're not writing POSIX portable software 
 here, but Linux software where /bin/sh is /bin/bash. Similar to the Linux 
 kernel which is not written in portable ISO C.

There's no rule that says /bin/sh is always /bin/bash.  What Novell
distributions do does not translate to all of Linux.  If you are writing
scripts that rely on bash then #!/bin/bash is the appropriate way to
document that and give it the best chance of working portably.

Sean
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Andi Kleen
On Saturday 23 June 2007 16:32:39 Alan Cox wrote:
 
 Having the scripts work with other shells is very helpful for porting,
 cross building and the like.

Well then for the majority of cross compile users you should consequently write 
them in Windows batch language.

 Also on Linux /bin/sh is not 
 neccessarily /bin/bash.

If it's not I think these few distributions give Linux a bad name 
because they introduce quite unnecessary incompatibilities.
Hopefully they are not widely used.

-Andi
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Andrew Morton
On Sat, 23 Jun 2007 10:43:03 -0700 Randy Dunlap [EMAIL PROTECTED] wrote:

  NAK.
 
 Sorry I slept thru another wonderful festival on LKML.

That's probably the best strategy.

 You don't have the authority to NAK the patch.

Yeah.  nak to naks.

 OTOH, you also didn't supply a patch.  If you do this, I'll be
 glad to consider it.  If I can read it, that is.

Yes, I plan on merging that patch as-is.  If it was a compulsory part of
kbuild then that would be a problem but as some optional tool I don't think
that a bashism matters much.  Someone can fix it sometime should they feel
so motivated.

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Randy Dunlap
On Sat, 23 Jun 2007 10:34:59 +0200 Oleg Verych wrote:

 * From: Randy Dunlap
 * Newsgroups: linux.kernel
 * Date: Fri, 22 Jun 2007 13:28:10 -0700
 * Organization: Oracle Linux Eng.
 
 []
  --- /dev/null
  +++ linux-2.6.22-rc5/scripts/decodecode
  @@ -0,0 +1,47 @@
  +#!/bin/sh
  +# Disassemble the Code: line in Linux oopses
  +# usage: decodecode  oops.file
 
 |-*- sh = dash -*-
 flower:-$ kernelOops.txt sh decodecode
 Jun 18 22:05:11 localhost kernel: Code: 00 00 00 eb 1b 6b 4e 38 05 89 ca 03 
 53 \
 1c 4a 89 d0 31 d2 f7 f1 89 da 89 c1 89 f0 e8 83 ed ff ff e8 26 af 12 00 8b 76 
 6\
 4 83 ee 64 8b 46 64 0f 18 00 90 81 fe 14 5c 37 c0 0f 85 70 ff ff ff b8 84
 decodecode: 31: Syntax error: Bad substitution
 flower:-$
 |-*-
 
 Or you are writing for #!/bin/bash, or i can help optimize and make
 this script sh compatible.
 
 NAK.

Sorry I slept thru another wonderful festival on LKML.

You don't have the authority to NAK the patch.

OTOH, you also didn't supply a patch.  If you do this, I'll be
glad to consider it.  If I can read it, that is.


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Matthieu CASTET
Hi,

On Sat, 23 Jun 2007 10:43:03 -0700, Randy Dunlap wrote:

 OTOH, you also didn't supply a patch.  If you do this, I'll be glad to
 consider it.  If I can read it, that is.

s|/bin/sh|/bin/bash is so hard to do ?

Matthieu

PS : this remind me http://www.landley.net/code/firmware/ . Is it so 
difficult to understand that sh is not bash. It is like assuming that 
everybody as a qwerty keyboard.

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Adrian Bunk
On Sat, Jun 23, 2007 at 10:56:45AM -0700, Andrew Morton wrote:
 On Sat, 23 Jun 2007 10:43:03 -0700 Randy Dunlap [EMAIL PROTECTED] wrote:
 
   NAK.
  
  Sorry I slept thru another wonderful festival on LKML.
 
 That's probably the best strategy.
 
  You don't have the authority to NAK the patch.
 
 Yeah.  nak to naks.
 
  OTOH, you also didn't supply a patch.  If you do this, I'll be
  glad to consider it.  If I can read it, that is.
 
 Yes, I plan on merging that patch as-is.  If it was a compulsory part of
 kbuild then that would be a problem but as some optional tool I don't think
 that a bashism matters much.  Someone can fix it sometime should they feel
 so motivated.

Oleg didn't express it very polite, but he has a valid point that bash 
scripts should start with #!/bin/bash since /bin/sh might be some 
shell other than bash.

Randy, am I right to assume that such a change to your patch would be OK?

cu
Adrian

-- 

   Is there not promise of rain? Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
   Only a promise, Lao Er said.
   Pearl S. Buck - Dragon Seed

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: NAK (bashizm in the /bin/sh script): [PATCH v3] doc/oops-tracing: add Code: decode info

2007-06-23 Thread Randy Dunlap

Adrian Bunk wrote:

On Sat, Jun 23, 2007 at 10:56:45AM -0700, Andrew Morton wrote:

On Sat, 23 Jun 2007 10:43:03 -0700 Randy Dunlap [EMAIL PROTECTED] wrote:


NAK.

Sorry I slept thru another wonderful festival on LKML.

That's probably the best strategy.


You don't have the authority to NAK the patch.

Yeah.  nak to naks.


OTOH, you also didn't supply a patch.  If you do this, I'll be
glad to consider it.  If I can read it, that is.

Yes, I plan on merging that patch as-is.  If it was a compulsory part of
kbuild then that would be a problem but as some optional tool I don't think
that a bashism matters much.  Someone can fix it sometime should they feel
so motivated.


Oleg didn't express it very polite, but he has a valid point that bash 
scripts should start with #!/bin/bash since /bin/sh might be some 
shell other than bash.


Randy, am I right to assume that such a change to your patch would be OK?


Sure.

--
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/