Re: proposed BASH_SOURCE_PATH

2024-05-14 Thread Léa Gris
ent dir ./real_bash_source_dir_test You can see it is able to source its library relative to its real installed path and it works regardless of if called from a symbolic link or directly from its installed dir. -- Léa Gris

Re: proposed BASH_SOURCE_PATH

2024-05-14 Thread Léa Gris
ame answer in both cases: ./tests/real_bash_source_dir_test ./real_bash_source_dir_test -- Léa Gris

Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax

2024-03-20 Thread Léa Gris
se put the JSON text string as the value. But possibly people are overusing Bash and shell for things that it was not designed for. In a lot of case, more general purpose scripting language are available to a wide range of systems. When your favorite tool is a hammer, problems tend to look

Re: Warn upon "declare -ax"

2023-09-04 Thread Léa Gris
c analysis tools like Shellcheck which might be expanded to ware of such incompatible flags but that's it. -- Léa Gris

Re: bug#65659: RFC: changing printf(1) behavior on %b

2023-09-02 Thread Léa Gris
e actual numbers vary a lot depending on request accuracy. Because there is no Regex replacement for a shell language parser; it cannot match all syntactically valid use cases, even with a carefully crafted Regex. -- Léa Gris

Re: string substitution broken since 5.2

2022-11-04 Thread Léa Gris
-effects? -- Léa Gris

Re: declare -x non-exportable variable types

2022-02-25 Thread Léa Gris
s with attributes is indeterminate"), which might be an appropriate clarification? -- Léa Gris

declare -x non-exportable variable types

2022-02-22 Thread Léa Gris
mpty value (same as referencing an associative array without a [key]. export upper; export lower # export with converted value export nameref # export with value of the referee This means that the export command would expand the variable value before exporting, but the declare, local and typeset statements would error if flags are incompatible with -x export. -- Léa Gris

Re: Long variable value get corrupted sometimes

2022-02-16 Thread Léa Gris
Le 16/02/2022 à 13:43, Greg Wooledge écrivait : text=$(cat /tmp/foo.txt; printf x) text=${text%x} or read -r -d '' text

Re: Interesting bug

2022-02-12 Thread Léa Gris
*)    exit 1     esac } } The bug is in your code. https://shellcheck.net/ static analysis for shell scripts can help you spot such syntax errors. -- Léa Gris

empty nameref issue

2021-11-28 Thread Léa Gris
ty state of a nameref is only obtained with an initial `declare -n ref`. There is no way to later clear or assign an empty string to a nameref unless destroying and recreating the nameref with: unset -n ref declare -n ref -- Léa Gris

Re: Arbitrary command execution in shell - by design!

2021-10-30 Thread Léa Gris
if a bash script is able to be abused, it is not bash's fault, neither the script's fault, but the system's security policies granting those privileges to the user running the script. -- Léa Gris

Re: Arbitrary command execution in shell - by design!

2021-10-29 Thread Léa Gris
enuine human errors, this is a red flag to avoid shell scripts and find a more suitable language/tool for this task. -- Léa Gris

Re: Arbitrary command execution from test on a quoted string

2021-10-28 Thread Léa Gris
ld be: test "${USER_INPUT@Q}" But it is not backward-compatible with older bash versions. Alternatively: declare -p USER_INPUT >/dev/null 2>&1 will work with much older bash versions Any other way witch are less bulky and or more backward compatible? -- Léa Gris

declare does not always set variable flags prior to assignment

2021-10-04 Thread Léa Gris
declare +i -A assoc=([yeet]=hello) declare -p assoc declare -A assoc=([yeet]="0" ) -- Léa Gris

Re: Request change to output of declare -f funcname

2021-10-02 Thread Léa Gris
Le 02/10/2021 à 18:45, Greg Wooledge écrivait : On Sat, Oct 02, 2021 at 06:06:32PM +0200, Léa Gris wrote: Better illustrated how newlines are discarded: $ sudo bash -c 'echo hello echo world' hello world $ sudo -i bash -c 'echo hello echo world' helloecho world OK, that's news to me

Re: Request change to output of declare -f funcname

2021-10-02 Thread Léa Gris
Le 02/10/2021 à 15:09, Greg Wooledge écrivait : On Sat, Oct 02, 2021 at 01:41:35PM +0200, Léa Gris wrote: $ declare -f hello hello () { echo 'hello'; echo 'world' } The issue is that in some circumstances, newline characters may be handled as space, making the function declaration

Request change to output of declare -f funcname

2021-10-02 Thread Léa Gris
for both the output of declare -p and declare -f -- Léa Gris

Re: efficient way to use matched string in variable substitution

2021-08-24 Thread Léa Gris
# shellcheck broken nameref usage check arr=("${BASH_REMATCH[@]:1}") } -- Léa Gris

Re: efficient way to use matched string in variable substitution

2021-08-24 Thread Léa Gris
Le 24/08/2021 à 14:06, Greg Wooledge écrivait : unicorn:~$ f6() { local i n=${#1} arr; for ((i=0; i See my featured version to also capture space and newlines: https://stackoverflow.com/a/68907322/7939871 -- Léa Gris

Re: efficient way to use matched string in variable substitution

2021-08-24 Thread Léa Gris
extglob # Split string characters into array IFS=' ' read -r -a array <<<"${n//?()/ }" # Debug print array declare -p array -- Léa Gris

Re: @K transformation

2021-08-20 Thread Léa Gris
az" 3 "qux" "${arr[@]@a}" expands into 4 argumsnts: 1. a 2. a 3. a 4. a Now @K would have been useful if it expanded into individual arguments for each entry rather than an eval expression. The @A suffers from the same weirdness expanding into an eval expression that actually duplicates the feature from declare -p. The @a expands the attribute from the container array for each element, which is as strange, because all array elements don't have attributes of their own. -- Léa Gris

Re: @K transformation

2021-08-20 Thread Léa Gris
Le 21/08/2021 à 00:06, Chet Ramey écrivait : On 8/19/21 6:37 AM, Léa Gris wrote: #!/usr/bin/env bash declare -A assoc=(   [P]=piano   [TB]='foldable table'   ['CH AIR']=chair ) options=("${assoc[@]@K}") The best way to clone an associative array is: declare -A options ev

Re: EPOCHREALTIME

2021-08-19 Thread Léa Gris
Le 19/08/2021 à 16:41, Eli Schwartz écrivait : On 8/19/21 9:41 AM, Léa Gris wrote: The error occurs, one would imagine, during the "convert string to float" stage, after parsing argv or forking to bc or whatever, but *before* passing it as an argument to printf(3). Here, bash is

Re: EPOCHREALTIME

2021-08-19 Thread Léa Gris
t, but the argument format's decimal separator is that of the system's locale. Imagine if C++ or Java had methods with different signature depending on system locale. You would scream fool. But for Bash, it was decided it was all fine. -- Léa Gris

Re: EPOCHREALTIME

2021-08-19 Thread Léa Gris
Han (LC_NUMERIC=C; echo "$EPOCHREALTIME") It will use a dot -- Léa Gris

Re: @K transformation

2021-08-19 Thread Léa Gris
into arguments and not expand quotes as string content. This would have made the @K expansion usable for dialog. Currently the associative array's key values pairs need be added to the options array in a for loop as: options=() for k in "${!assoc[@]}"; do options+=("$k" "${assoc[$k]}") done -- Léa Gris

feature request array expansion of keys values pairs and for k v loop

2021-08-18 Thread Léa Gris
ng the value with statement within the loop. Obviously it would fit equally well with associative arrays. -- Léa Gris

Re: Issue declaring an array via a variable name

2021-08-15 Thread Léa Gris
; \"me\" )" declare -g "$variable"'=( "world" "me" )' Be cautious with dynamic declare statements, because it is as insecure as eval. It will execute statements contained in variables. -- Léa Gris

Re: gettext feature request

2021-08-13 Thread Léa Gris
a.sh:7 msgid "String %1$q has %2$d characters\n" msgstr "%2$d Zeichen lang ist die Zeichenkette %1$q\n" ``` In default English, the output would be: ```none String Hello\ World\! has 12 characters ``` In German, the output would be: ```none 11 Zeichen lang ist die Zeichenkette Hallo\ Welt\! ``` -- Léa Gris

Re: gettext feature request

2021-07-24 Thread Léa Gris
rintf format string context to maintain backward compatibility. -- Léa Gris

Re: Crash on large brace expansion

2021-07-15 Thread Léa Gris
Le 15/07/2021 à 21:23, Greg Wooledge écrivait : On Thu, Jul 15, 2021 at 05:28:04PM +0200, Léa Gris wrote: Le 15/07/2021 à 16:36, Gabríel Arthúr Pétursson écrivait : Hi all, Executing the following results in a fierce crash: $ bash -c '{0..255}.{0..255}.{0..255}.{0..255}' Brace

Re: Crash on large brace expansion

2021-07-15 Thread Léa Gris
c=0; c<=255; c++)); do for ((d=0; d<=255; d++)); do printf '%d.%d.%d.%d\n' "$a" "$b" "$c" "$d" done done done done -- Léa Gris

Re: [PATCH] Prefer non-gender specific pronouns

2021-06-07 Thread Léa Gris
and everyone has fought each-other. Then they will vanish and destroy other community, other history. -- Léa Gris

Re: Prefer non-gender specific pronouns

2021-06-06 Thread Léa Gris
ion, ^^^ French "son" (his) is male because "répertoire" (directory) is male in French. User character's gender is not even mentioned. -- Léa Gris

Re: [PATCH] Prefer non-gender specific pronouns

2021-06-06 Thread Léa Gris
from cancel culture tenants. With all your clever carefulness in patching this. It remains a rewrite of history motivated by political reasons from a lobbying group of people spreading their damaging delusions everywhere. -- Léa Gris

Re: Prefer non-gender specific pronouns

2021-06-06 Thread Léa Gris
people's grammar, "they" is a plural pronoun. -- Léa Gris

Re: Prefer non-gender specific pronouns

2021-06-05 Thread Léa Gris
ll heavily hot debated and politically loaded changes into technical projects like Bash. -- Léa Gris

Feature request: index of index

2021-05-06 Thread Léa Gris
declare -i last_index="42" It would be convenient to be able to index directly with this syntax: declare -i first_index=${!array[@]:0:1} declare -i last_index=${!array{@}: -1:1} -- Léa Gris

Bash development roadmap

2021-04-30 Thread Léa Gris
expect being on every systems, even older and no longer supported ones? -- Léa Gris

Re: Undocumented feature: Unnamed fifo '<(:)'

2021-04-08 Thread Léa Gris
/59e1b7e72462024b278652696f375e71 There is no need for bash specific features, although coproc and other fancynesses can help, these lack portability. -- Léa Gris

Re: is it a bug that \e's dont get escaped in declare -p output

2021-03-17 Thread Léa Gris
ocarray=([$'1\E[G\E[K2']=$'and \E esc' [$'new \n line']=$'1\E[G\E[K2' ) declare -i intvar=42 declare -ai intarray=([0]="-42" [1]="666" [2]="555") declare -Ai intassoc=([$'1\E[G\E[K2']="456" [foo]="123" [bar]="789" ) declare -i nameref=42 -- Léa Gris OpenPGP_signature Description: OpenPGP digital signature

Re: is it a bug that \e's dont get escaped in declare -p output

2021-03-17 Thread Léa Gris
the produced declare statement just works as-is. It is not user friendly but code friendly and compact if you use the declare -p foo bar baz >savedvars.sh for later include savedvars.sh -- Léa Gris OpenPGP_signature Description: OpenPGP digital signature

Re: Changing the way bash expands associative array subscripts

2021-03-15 Thread Léa Gris
t; printf '%s -> %s\n' "$key" "$value" done I'd love there would be more convergence when this is possible. -- Léa Gris OpenPGP_signature Description: OpenPGP digital signature

Re: Behaviour of test -v with assoc array and quote character in key

2021-02-23 Thread Léa Gris
into the array. Works, if you declare your associative array with A and i flags: ( LANG=C unset var assoc var=\'\] declare -Ai assoc assoc[$var]=1 assoc[$var]+=1 ((assoc['$var']++)) typeset -p assoc ) Output: declare -Ai assoc=(["']"]="3" ) -- Léa Gris

Assign read-only variables return code not usable inline

2021-02-23 Thread Léa Gris
, after: r=2 || exit 2 still there with $?=1, after: if ! r='hello'; then exit; fi declare -r r -- Léa Gris

Re: Behaviour of test -v with assoc array and quote character in key

2021-02-23 Thread Léa Gris
) bash: ']: syntax error: operand expected (error token is "']") but: $ (LANG=C; unset var assoc; var=\'\]; declare -A assoc; assoc[$var]=hello; typeset -p assoc) declare -A assoc=(["']"]="hello" ) -- Léa Gris

Re: export loses error

2021-02-08 Thread Léa Gris
. Kind of annoying, sure, but not a bug. https://mywiki.wooledge.org/BashPitfalls#local_var.3D.24.28cmd.29 vq Or this https://github.com/koalaman/shellcheck/wiki/SC2155 Nice helping shell linter would have warned of this pitfall. -- Léa Gris

Re: RFE: new syntax for command substitution to keep trailing newlines?

2021-01-27 Thread Léa Gris
(formerly Ctrl + Z) that is unlikely to be part of a legit string: a=$(printf $'hello\n\n\n\32'); a=${a%$'\32'}; declare -p a -- Léa Gris

Re: Feature Request: scanf-like parsing

2021-01-25 Thread Léa Gris
sh feature is not an option anyway, and sometimes, yes eval will help. -- Léa Gris

Re: Feature Request: scanf-like parsing

2021-01-22 Thread Léa Gris
Le 22/01/2021 à 19:18, Léa Gris écrivait : Now replace the the () with {}, replace the implicit temporary fifo by and implicit temporary file; then have the same feature but without spawning a sub-shell. Instead of: tempfile=$(mktemp) || exit 1 trap 'rm -f "$tempfile"' EXIT

Re: Feature Request: scanf-like parsing

2021-01-22 Thread Léa Gris
; then have the same feature but without spawning a sub-shell. -- Léa Gris

Re: Feature Request: scanf-like parsing

2021-01-22 Thread Léa Gris
a temporary file in /tmp or /dev/shm rather-than a temporary named fifo as with < <(:). -- Léa Gris

Re: ${a:=b} expands to `b', not `a''s value

2021-01-20 Thread Léa Gris
Le 20/01/2021 à 13:51, Andreas Schwab écrivait : But that's not the value of the parameter. It is not, since at this point, the parameter has no value, the expansion expands the argument's value after ;= which is uppercase X here. -- Léa Gris

Re: ${a:=b} expands to `b', not `a''s value

2021-01-20 Thread Léa Gris
The fact that an expansion also assign a value is a questionable design choice though. If I had to use this I would just silence the expansion as an argument to the dummy true or : command : ${a:=X} Is this a bug or am I missing something here? Then likely not. -- Léa Gris

Re: echo $'\0' >a does not write the nul byte

2021-01-17 Thread Léa Gris
ne of them will output a null byte. The only way to output a null byte with shell built-in is: printf '\0' or non portable: echo -ne '\0' This is because `\0' is not a null byte or a nulll string but interpreted internally to the command to print a null byte. -- Léa Gris

Re: V+=1 doesn't work if V is a reference to an integer array element

2021-01-14 Thread Léa Gris
Le 14/01/2021 à 16:15, Chet Ramey écrivait : On 1/13/21 4:40 PM, Léa Gris wrote: Le 13/01/2021 à 22:13, Chet Ramey écrivait : The `-i' forces arithmetic evaluation, which makes this expand to the equivalent of `declare -n b=1'. That's an invalid name for a nameref, which you'd see if you used

Re: V+=1 doesn't work if V is a reference to an integer array element

2021-01-13 Thread Léa Gris
: declare -ai a=([0]="4") declare -in b="a[0]" declare -ai a=([0]="10") declare -in b="a[0]" I set the integer attribute to the nameref b after it has been assigned the "a[0]" string, so it keeps its string nameref value but is now also considered as an integer value. -- Léa Gris

Re: V+=1 doesn't work if V is a reference to an integer array element

2021-01-13 Thread Léa Gris
unset a b declare -ai a=(1) declare -in b="a[0]" declare -p a b declare -ai a=([0]="1") declare -in b="a[0]" b+=1 declare -p a declare -ai a=([0]="3") b+=1 declare -p a declare -ai a=([0]="7") b+=0 declare -p a declare -ai a=([0]="14") -- Léa Gris

Re: Associative array keys are not reusable in (( command

2021-01-11 Thread Léa Gris
Le 11/01/2021 à 15:42, Léa Gris écrivait : Declare an integer associative array instead: echo "$BASH_VERSION" 5.0.17(1)-release declare -Ai aa x='y[$(date >&2)0]' aa[$x]=1 declare -p aa declare -Ai aa=(["y[\$(date >&2)0]"]="1" ) aa[$x]+=1 decl

Re: Associative array keys are not reusable in (( command

2021-01-11 Thread Léa Gris
Declare an integer associative array instead: echo "$BASH_VERSION" 5.0.17(1)-release declare -Ai aa x='y[$(date >&2)0]' aa[$x]=1 declare -p aa declare -Ai aa=(["y[\$(date >&2)0]"]="1" ) aa[$x]+=1 declare -p aa declare -Ai aa=(["y[\$(date >&2)0]"]="2" ) -- Léa Gris

Re: declare accept + before =

2021-01-08 Thread Léa Gris
Le 08/01/2021 à 15:26, Chet Ramey écrivait : On 1/8/21 8:45 AM, Léa Gris wrote: Just curious why it accepts a + before = Try it with a variable that already has a value. OMG I feel stupid now! -- Léa Gris

declare accept + before =

2021-01-08 Thread Léa Gris
Just curious why it accepts a + before = unset a; declare a+=hello; typeset -p a bash, version 5.0.17(1)-release wrote: > declare -- a="hello" -- Léa Gris

Re: New Feature Request

2021-01-04 Thread Léa Gris
Le 04/01/2021 à 14:14, Greg Wooledge écrivait : It should be noted that $( var=$(ending the last line because it exactly a sub-shell shot syntax for var=$(cat file). Sub-shell $(commands list) output is always trimmed. -- Léa Gris

Re: 'Find' inside loop buggy, incorrectly make up dir.

2021-01-01 Thread Léa Gris
or move files. -- Léa Gris

Re: Checking executability for asynchronous commands

2020-12-28 Thread Léa Gris
a sub-shell background command, then shame on them. -- Léa Gris

Re: New Feature Request

2020-12-27 Thread Léa Gris
ces, Bash is a very bad choice. If you want to stay with scripting, as you already mentioned using Python; Python is a way better choice for dealing with the features and requirements you describes. -- Léa Gris

Re: [feature request] add associative array support to mapfile

2020-12-17 Thread Léa Gris
Le 17/12/2020 à 17:58, Léa Gris écrivait : Maybe (it is clearly open to discussion), the associative array mapping could be allowed to: - skip blank/comment only lines (1) - allow key without value - optionally trim trailing comment (1) Forgot about Bash built-in Regex engine: - allow using

Re: [feature request] add associative array support to mapfile

2020-12-17 Thread Léa Gris
Le 17/12/2020 à 17:35, Chet Ramey écrivait : One problem I see with it is that it assumes the introduction of word splitting into mapfile, with the burden on the user to ensure that there are exactly two resultant fields. It is just meant to be a replacement to looping on: IFS= read -r -d k

Re: mapfile associative array shim Was: Re: [feature request] add associative array support to mapfile

2020-12-17 Thread Léa Gris
Shorty shim: ! { mapfile -A _/dev/null&&{ mapfile(){ local k v d=$'\n';local -n A=${*: -1:1};[ ${*: -2:1} = -A ]&&{ [ ${*:1:1} = -d ]&=${*:2:1};while read -rd "$d" k v||[[ -n $k && -n $v ]];do A[$k]=$v;done;:;}||command mapfile "$@";};} -- Léa Gris

mapfile associative array shim Was: Re: [feature request] add associative array support to mapfile

2020-12-17 Thread Léa Gris
{*: -2:1} = -A ]] && { [[ ${*:1:1} = -d ]] && d=${*:2:1} while read -r -d "$d" k v || [[ -n $k && -n $v ]] do A[$k]=$v done true } || command mapfile "$@" } } Example usage: . mapfile_assoc_shim.bash IFS='=' mapfile -d '' -A assoc_null < <(kv_null_stream) -- Léa Gris

[feature request] add associative array support to mapfile

2020-12-17 Thread Léa Gris
assoc_null Expected output: declare -A assoc_cr=([key2]="value=2" [key1]="value1" ["key 3"]="value3" ) declare -A assoc_null=([key2]="value=2" [key1]="value1" [$'key\n3']="value3" ) -- Léa Gris

mysteries with the placeholder variable _

2020-12-12 Thread Léa Gris
nd accept assignment, which is probably conformant to POSIX shell specifications. -- Léa Gris

Re: No expansions performed while declaring an associative array using a list of keys and values

2020-12-11 Thread Léa Gris
quot; ) What would have been so useful is expanding mapfile to associative arrays: key${IFS}value declare -A assoc IFS='= ' mapfile -t assoc <declare -A assoc(["key1"]="value1" ["key2"]="value2" ["key3"]=$'{\n "otherkey": "othervalue"\n}' -- Léa Gris

Re: No expansions performed while declaring an associative array using a list of keys and values

2020-12-11 Thread Léa Gris
t does not split a key variable: foo='1 2' declare -A bar=([$foo]=3 ) Or double square bracket tests: foo='1 2' [[ $foo == '1 2' ]] Did you try with?: # possibly originating read -a or mapfile declare -a foo=(1 2 ) # Declare associative array from key value array above declare -A assoc=("${foo[@]}" 3) -- Léa Gris

Variables declared in arithmetic expressions have no i flag

2020-11-24 Thread Léa Gris
typeset -p x > declare -- x="42624" unset x; declare -i x; ((x = 42)); x+=624; typeset -p x > declare -i x="666" -- Léa Gris

No longer receifing nntp feed from here

2020-11-17 Thread Léa Gris
Anyone to look why this is no longer connected to the bug-bash@gnu.org ML? -- Lea Gris

Re: use of set -e inside parenthesis and conditionnal second command

2020-11-17 Thread Léa Gris
straight exit without any cleanup or fallback. This feature deserves a bold disclaimer to think twice before using it rather than explicit error handing. -- Léa Gris

Re: [ping] declare -c still undocumented.

2020-11-13 Thread Léa Gris
craft so long to lerne.'' - Chaucer Chet Ramey, ITS, CWRUaddress@hiddenhttp://cnswww.cns.cwru.edu/~chet/ -- Léa Gris

[ping] declare -c still undocumented.

2020-11-12 Thread Léa Gris
cument in usage:, add to builtin help. -- Léa Gris OpenPGP_0x70946F168078ED52.asc Description: application/pgp-keys OpenPGP_signature Description: OpenPGP digital signature

Lack of documentation about mapfile callback

2020-02-08 Thread Léa Gris
man bash.1 > When callback is evaluated, it is supplied the index of the next > array element to be assigned and the line to be assigned to that > element as additional arguments. callback is evaluated after the > line is read but before the array element is assigned. I can not find real-life

Re: Two states of empty arrays

2019-12-12 Thread Léa Gris
Le 12/12/2019 à 20:13, Chet Ramey écrivait : >> # Empty array declared without parenthesis >> unset myArr >> declare -a myArr >> typeset -p myArr >> echo "${#myArr[@]}" > > This is an unset variable with the array attribute; you have not assigned a > value. >> # Empty array declared without

Two states of empty arrays

2019-12-12 Thread Léa Gris
rr declare -a myArr=() typeset -p myArr echo "${#myArr[@]}" output: declare -a myArr=() 0 What is the reason for having different states for empty arrays? -- Lea Gris -- Léa Gris signature.asc Description: OpenPGP digital signature

Two states of empty arryays

2019-12-12 Thread Léa Gris
Hello, Depending on how an empty array is declared, it is not stored with the same state. # Empty array declared without parenthesis unset myArr declare -a myArr typeset -p myArr echo "${#myArr[@]}" output: declare -a myArr 0 # Empty array declared without parenthesis unset myArr declare -a

Associative array entries order differs from declaration

2019-08-15 Thread Léa Gris
uot;]="second"); a+=(["three"]="third"); a+=(["four"]="last"); typeset -p a Is there a way to control the order of entries in an associative array? What rules applies to the order of entries? -- Léa Gris signature.asc Description: OpenPGP digital signature

errata: Explicit variables declaration statements do not resolve back-references from same statement

2019-07-24 Thread Léa Gris
;$a $b":\n=> ' printf $"a='%s' b='%s' c='%s'\\n" "$a" "$b" "$c" knip code end Output: bash ./test_declare.sh Explicit declarations statements: typeset -i a=2 b=$a c="$((a - 1))": => a=2 b=0 c=-1 declare a=hello b=world c="

Explicit variables declaration statements do not resolve back-references from same statement

2019-07-24 Thread Léa Gris
: declare: not found [Aucun fichier ou dossier de ce type] a='' b='' c='' Implicit declarations statements: a=2 b=$a c="$((a - 1))": => a=2 b=2 c=1 a=hello b=world c="$a $b": => a='hello' b='world' c='hello world' ksh93 resolves explicit back-references with typeset. -- Léa Gris signature.asc Description: OpenPGP digital signature

Re: Unexpected result of array assignment

2019-07-18 Thread Léa Gris
;${_v} value2") declare -p foo Still safer than eval for an extra intermediary assignment. And allow you to insert the old value of ${foo=["key"]} anywhere in-between. The += string concatenation would not work in this case. -- Léa Gris signature.asc Description: OpenPGP digital signature

Re: built-in printf %f parameter format depend on LC_NUMERIC

2019-07-12 Thread Léa Gris
Le 12/07/2019 à 21:16, Chet Ramey écrivait : On 7/12/19 12:46 PM, Léa Gris wrote: Le 09/07/2019 à 22:02, Chet Ramey écrivait : These are up to the system's strtol/strtod. I don't know of too many strtol implementations that use the thousands separator and numeric grouping. Chet and you

Re: built-in printf %f parameter format depend on LC_NUMERIC

2019-07-12 Thread Léa Gris
the incentives behind this library/stand-alone command, that may shed some light on how the Bash's printf implementation of the %f format can be an issue. Be glad if it can helps in some way. Do what the F** you want with it :) -- Léa Gris signature.asc Description: OpenPGP digital signature

Re: built-in printf %f parameter format depend on LC_NUMERIC

2019-07-09 Thread Léa Gris
s_sep LC_NUMERIC thousands_sep=" " $ printf '%d\n' '1 000 000' bash: printf: 1 000 000: nombre non valable 1 -- Léa Gris signature.asc Description: OpenPGP digital signature