[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: Re: bb's bash errors in a script that works in normal bash
From: daggs <daggs () gmx ! com>
Date: 2020-08-25 21:03:02
Message-ID: trinity-537855ec-0af3-4eb0-8f35-9b40e7a53257-1598389382201 () 3c-app-mailcom-bs14
[Download RAW message or body]
Greetings,
is there a way to workaround it somehow?
> Sent: Tuesday, August 25, 2020 at 7:11 PM
> From: "Markus Gothe" <nietzsche@lysator.liu.se>
> To: "daggs" <daggs@gmx.com>, busybox@busybox.net
> Subject: Re: bb's bash errors in a script that works in normal bash
>
> Correct, it is not part of the Almquist shell. So it not supported yet AFAIK, \
> however in busybox there are some bash-compatiblity hacks so it might be \
> implemented one day.
> //Markus
>
> Sent from my BlackBerry - the most secure mobile device
>
>
> Original Message
>
>
> From: daggs@gmx.com
> Sent: August 25, 2020 14:39
> To: busybox@busybox.net
> Subject: bb's bash errors in a script that works in normal bash
>
>
> Greetings,
>
> I have the following script:
> $ cat test1.sh
> #!/bin/bash -x
>
> do_trace() {
> local depth=0
>
> [ -z "${CT_XLDD_VERBOSE}" ] && return 0
>
> for((depth=0; "${#FUNCNAME[$((depth+1))]}" != 0; depth++)); do :; done
> printf "%*s" $((4*(depth-1))) "" >&2
> printf -- "$@" >&2
> }
>
> do_trace
>
> when I run it with normal bash it works, with bb's bash it doesn't, see:
>
> $ /tmp/busybox-1.32.0/busybox bash ./test1.sh
> bash: syntax error: unterminated ${name}
> BusyBox v1.32.0 (2020-08-25 15:22:10 IDT) multi-call binary.
>
> Usage: bash [-enxl] [-c 'SCRIPT' [ARG0 [ARGS]] / FILE [ARGS] / -s [ARGS]]
>
> Unix shell interpreter
> $ ./test1.sh
> + do_trace
> + local depth=0
> + '[' -z '' ']'
> + return 0
>
> as I understand it, FUNCNAME is not implemented in bb, am I correct?
>
> Thanks,
>
> Dagg.
> _______________________________________________
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
>
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic