Hello,
Please look at the minimal working example below.
GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)
Ubuntu 22.04.5 LTS
*01a.sh*
#!/bin/bash
set -e
echo "01a - 1 "
./02.sh
echo "01a - 2 "
*01b.sh*
#!/bin/bash
set -e
echo "01b - 1 "
./02.sh && echo "You will not see this"
ur subst version is best and fastest
, the my last version seems buggy
its to filter out numbers
.. just a bit related to the topic sorry ..
++ greets ++
On Tue, Feb 11, 2025, 10:23 AM Phi Debian wrote:
>
> Can follow that fast, the n-1 version gives
>
> gimme_num( ) { local y o m='[0-9,.]' s=
On Tue, Feb 11, 2025, 7:13 AM Phi Debian wrote:
>
>
> On Mon, Feb 10, 2025 at 11:46 PM microsuxx wrote:
>
>> a bit unrelated .. cheap numbers filter ..
>>
>> gimme_num( ) { declare -n b=BASH_REMATCH\[1] ; local o m=[0-9,.] s=$n i t
>> ;
>> t="(-?$m+)" ; unset -v o ; for n ; do unset -v i ; while
here updated faster version ..
gimme_num( ) { local y o m='[0-9,.]' s=$'\n' i t ; t="(-?$m+)" ; unset -v o
; for n ; do i= ; if [[ $n =~ $t ]] ; then while [[ -v BASH_REMATCH[++i] ]]
; do o+=${BASH_REMATCH[i]}$s ; done ; fi ; [[ $i != 1 ]] && o+=$s ; done ;
[[ -v o ]] && printf %s "$o" ; }
On Tue
Can follow that fast, the n-1 version gives
gimme_num( ) { local y o m='[0-9,.]' s=$'\n' i t ; t="(-?$m+)" ; unset -v o
; for n ; do unset -v i ; while [[ $n =~ $t ]] ; do y=${BASH_REMATCH[1]}
n=${n/"$y"} i= o+=$y$s ; done ; [[ -v i ]] && o+=$s ; done ; [[ -v o ]] &&
printf %s "$o" ; }
$ gimme_num
On Tue, Feb 11, 2025 at 9:37 AM microsuxx wrote:
> how does it output strings .. ?
> i mean i dont get ur outputs
> 1 it doesnt include # and @ etc
> 2 no hex etc yet , only numbers and dots / commas
>
> gimme_num 0x10 60#yo 0x10
> 0
> 10
>
> 60
>
> 0
> 10
>
> but i dont get ur outputs such as 0x
ah , cool
.. my bash 5.3 dev seems to have declare -n arr\[elem] while i think the
old 5.2x that didnt work
try plzz ..
gimme_num( ) { local y o m='[0-9,.]' s=$'\n' i t ; t="(-?$m+)" ; unset -v o
; for n ; do unset -v i ; while [[ $n =~ $t ]] ; do y=${BASH_REMATCH[1]}
n=${n/"$y"} i= o+=$y$s ; do
On Tue, Feb 11, 2025, at 9:18 AM, Greg Wooledge wrote:
> Look at the definition of set -e:
>
> -e Exit immediately if a pipeline (which may consist of a
> single simple command), a list, or a compound command
> (see SHELL GRAMMAR abov