j
: Next unread message k
: Previous unread message j a
: Jump to all threads
j l
: Jump to MailingList overview
Hello,
On Ubuntu Karmic `./config/scripts/switch-arch cross-ppc` did not recognize my powerpc-elf-gcc. The GNOME Terminal appears to use bash, where `type -p powerpc-elf-gcc && echo yah` works, but /bin/sh is dash, where it does not: echo "type -p powerpc-elf-gcc && echo yah" | /bin/sh
The following change made it work.
Andreas
diff --git a/config/scripts/switch-arch b/config/scripts/switch-arch index c145e86..19dd877 100755 --- a/config/scripts/switch-arch +++ b/config/scripts/switch-arch @@ -88,7 +88,7 @@ select_prefix() { for TARGET in ${1}-linux-gnu- ${1}-elf- ${1}-eabi- do - if type -p ${TARGET}gcc > /dev/null + if which ${TARGET}gcc > /dev/null then return fi
On 4/23/10 2:44 PM, Andreas Färber wrote:
Hello,
On Ubuntu Karmic `./config/scripts/switch-arch cross-ppc` did not recognize my powerpc-elf-gcc. The GNOME Terminal appears to use bash, where `type -p powerpc-elf-gcc && echo yah` works, but /bin/sh is dash, where it does not: echo "type -p powerpc-elf-gcc && echo yah" | /bin/sh
Ouch... I think we should change the script to use #!/bin/bash ...
If the next best distribution decides to go for tcsh, we're in trouble again, otherwise..
diff --git a/config/scripts/switch-arch b/config/scripts/switch-arch index c145e86..19dd877 100755 --- a/config/scripts/switch-arch +++ b/config/scripts/switch-arch @@ -88,7 +88,7 @@ select_prefix() { for TARGET in ${1}-linux-gnu- ${1}-elf- ${1}-eabi- do
if type -p ${TARGET}gcc > /dev/null
if which ${TARGET}gcc > /dev/null then return fi
Hello Stefan,
Am 23.04.2010 um 15:17 schrieb Stefan Reinauer:
On 4/23/10 2:44 PM, Andreas Färber wrote:
On Ubuntu Karmic `./config/scripts/switch-arch cross-ppc` did not recognize my powerpc-elf-gcc. The GNOME Terminal appears to use bash, where `type -p powerpc-elf-gcc && echo yah` works, but /bin/sh is dash, where it does not: echo "type -p powerpc-elf-gcc && echo yah" | /bin/sh
Ouch... I think we should change the script to use #!/bin/bash ...
Please don't! On BSDs it may be /usr/local/bin/bash. And /usr/bin/env bash would fail in the BeOS world.
Andreas
Am 23.04.2010 um 14:44 schrieb Andreas Färber:
On Ubuntu Karmic `./config/scripts/switch-arch cross-ppc` did not recognize my powerpc-elf-gcc. The GNOME Terminal appears to use bash, where `type -p powerpc-elf-gcc && echo yah` works, but /bin/sh is dash, where it does not: echo "type -p powerpc-elf-gcc && echo yah" | /bin/sh
...and if we actually do it like that, without 2>/dev/null, we see: -p: not found
So dash's `type` does not seem to support the -p parameter, whatever that does. Without -p it works, too.
Andreas
diff --git a/config/scripts/switch-arch b/config/scripts/switch-arch index c145e86..b7511e7 100755 --- a/config/scripts/switch-arch +++ b/config/scripts/switch-arch @@ -88,7 +88,7 @@ select_prefix() { for TARGET in ${1}-linux-gnu- ${1}-elf- ${1}-eabi- do - if type -p ${TARGET}gcc > /dev/null + if type ${TARGET}gcc > /dev/null then return fi