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

2024-03-24 Thread Dennis Williamson
On Sun, Mar 24, 2024 at 4:04 PM Greg Wooledge wrote: > The @K (capital) transformation gives you quoted strings which need to > be eval'ed. Very Bourne-shell-ish. > > The @k (lowercase) transformation gives you a list of alternating raw > key/value strings, like what you'd expect from a Tcl comm

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

2024-03-24 Thread Dennis Williamson
On Sun, Mar 24, 2024 at 1:56 PM Greg Wooledge wrote: > It would be pretty reasonable to have a builtin that could take an array > name plus any number of additional argument pairs, and load those pairs > as keys/values into said array. Then you could do something like this: > > declare -A ha

Re: Make reverse-i-search failure joltingly clear

2023-12-10 Thread Dennis Williamson
On Mon, Dec 11, 2023 at 1:09 AM Dan Jacobson wrote: > Type ^R and some string, > At the point while we are typing that the search fails, all that > happens is the word "failed" gets added at front, > > (reverse-i-search)`nni': set > jida^Ci.org/geo/house_numbering/grids/us/il/lake/lake_county/ >

Fwd: Strange results

2023-10-26 Thread Dennis Williamson
-- Forwarded message - From: Dennis Williamson Date: Thu, Oct 26, 2023 at 12:09 PM Subject: Re: Strange results To: Victor Pasko echo "echo11 ${ASCII_SET:-10:1}"echo "echo11 ${ASCII_SET:-10:1}" On Thu, Oct 26, 2023 at 9:54 AM Victor Pasko wrote: > Hi,

Re: Assignment to RO variable

2023-08-15 Thread Dennis Williamson
On Tue, Aug 15, 2023 at 8:57 PM Wiley Young wrote: > So this behavior of `bash`s seems like a bug to me. I stumbled across it by > accident. > > From within a stack of x3 functions called from a case within a for loop, > when trying to assign a value to a read-only variable, `printf` and `read` >

Re: built-in printf returns success when integer is out of range

2023-07-26 Thread Dennis Williamson
On Wed, Jul 26, 2023, 3:40 PM wrote: > Configuration Information [Automatically generated, do not change]: > Machine: x86_64 > OS: linux-gnu > Compiler: gcc > Compilation CFLAGS: -g -O2 -fstack-protector-strong -Wformat > -Werror=format-security -Wall > uname output: Linux fnord42 6.1.25-1rodete1

Re: [PATCH 1/2] <<# indent-stripping heredoc

2023-07-14 Thread Dennis Williamson
On Fri, Jul 14, 2023, 3:44 AM Grisha Levit wrote: > On Fri, Jul 14, 2023 at 3:44 AM Martin D Kealey > wrote: > > > > On the whole I think this is great, and thankyou for working up the > patch, but I would like to offer some comments and suggestions: > > Thanks for looking at it, feedback very m

Re: Document m=1 m=2; echo $m result

2023-07-03 Thread Dennis Williamson
On Mon, Jul 3, 2023 at 11:11 AM alex xmb ratchev wrote: > > > > thats a like 30% or smth > enuff for me > i d be the fool typing nonsensly ; s > Do what you like, but percentages don't mean anything unless you're running a lot of assignments in a loop like the artificial conditions in the test I

Re: Document m=1 m=2; echo $m result

2023-07-03 Thread Dennis Williamson
On Mon, Jul 3, 2023 at 10:32 AM alex xmb ratchev wrote: > > i chain assignments , have impression its faster > > kre > > > > > > > Tests are better than impressions. Sometimes they match though. $ time for ((i = 0; i <= 100; i++)); do j=$i; k=$j; m=10; n=foobarbazqux; p=100; q=$n; r=$k;

Re: Funny behaviour of associative arrays

2023-06-27 Thread Dennis Williamson
On Tue, Jun 27, 2023 at 12:29 AM n952162 wrote: > Is this correct? > > declare -A l1 > > l1=([a]=b [c]=d) > echo ${!l1[@]} > > l1=($(echo [a]=b [c]=d)) > echo ${!l1[@]} > > $ bash t4 > c a > [a]=b [c]=d > > If so, why? And how can I assign a list of members to an associative

Re: It is possible that this can be a bug

2023-06-26 Thread Dennis Williamson
On Mon, Jun 26, 2023, 2:47 PM Hugo Napoli wrote: > Dear Dennis and Martin, thank you very much for the quick response. > > From now on, I'll use *exec bash "$0" *instead of *bash "$0"*. > What I'm wondering is (now that I understand why this happened) if there > is some special situation where it

Re: It is possible that this can be a bug

2023-06-26 Thread Dennis Williamson
On Mon, Jun 26, 2023, 11:07 AM Hugo Napoli wrote: > Good day. > > Something strange is happening to me with this script that I have designed > moments ago. > I am a Computer Science professor, and among the subjects I teach, there is > one that has to do with BASH programming. > I make my own mat

Re: Fwd: Command execution by creating file.

2023-06-20 Thread Dennis Williamson
On Tue, Jun 20, 2023 at 10:55 PM LitHack wrote: > Sorry instead of alias we have to use the function. > > Corrected command: mkdir dir;cd dir;<>file;file()bash;* > > Thanks and regards. > You don't need the function either. mkdir dir; cd dir; touch bash; * -- Visit serverfault.com to get yo

Re: New array_expand_once option

2023-06-17 Thread Dennis Williamson
On Sat, Jun 17, 2023, 6:59 AM alex xmb ratchev wrote: > On Thu, Jun 15, 2023, 20:40 alex xmb ratchev wrote: > > > > > > > On Thu, Jun 15, 2023, 15:06 Chet Ramey wrote: > > > >> On 6/14/23 5:18 PM, alex xmb ratchev wrote: > >> > >> > [[ -v a["$subscript"] ]] > >> > > > a small question about

Re: Searches in bash don't works

2023-05-24 Thread Dennis Williamson
On Wed, May 24, 2023, 5:21 PM William via Bug reports for the GNU Bourne Again SHell wrote: > Hi. It's the first time I send a message about a bug using bashbug. I > don't known if the message was sent properly. So, I repeat it that way. > > > Machine: i686 > > OS: linux-gnu > Compiler: gcc > Com

Re: Bash Reference Manual Type

2023-03-31 Thread Dennis Williamson
On Fri, Mar 31, 2023, 3:02 PM Martin Schulte wrote: > Hi Dennis, > > thanks for your answer! > > > This isn't regex. > > Sure! > > > It's a command synopsis using a long standing notation > > style. You can see it set out in POSIX in > > > https://pubs.opengroup.org/onlinepubs/9699919799/basedefs

Re: Bash Reference Manual Type

2023-03-31 Thread Dennis Williamson
On Fri, Mar 31, 2023, 2:47 PM Martin Schulte wrote: > Hi Chet! > > > >> Thanks for the report. The synopsis should read > > >> > > >> cd [-L|[-P [-e]]] [-@] [dir] > > > ^ ^ > > > But aren't these two brackets just superfluous? > > > > -L and -P are mutually exclusive, and -e is va

Re: Multiline editing breaks if the previous output doesn't end in newline

2022-10-30 Thread Dennis Williamson
On Sun, Oct 30, 2022 at 4:41 PM Alex fxmbsw7 Ratchev wrote: > > > i coded a files tree to bash code via gawk reading and printing bash code > i did noeol no newline at end > logically , cause , who wants var='from file\n' > > > > Because command substitution strips trailing newlines? $ echo -e

Re: bash core dumps doing glob pattern on long string

2022-10-11 Thread Dennis Williamson
On Tue, Oct 11, 2022, 3:12 PM Greg Wooledge wrote: > On Tue, Oct 11, 2022 at 12:38:44PM -0700, Koichi Murase wrote: > > As far as I know, glob/extglob > > does not have constructs that cannot be represented by formal regular > > languages so should always be able to be represented by NFAs and thu

Re: read problem

2022-09-24 Thread Dennis Williamson
On Sat, Sep 24, 2022 at 11:02 AM kurt wrote: > Configuration Information [Automatically generated, do not change]: > Machine: x86_64 > OS: linux-gnu > Compiler: gcc > Compilation CFLAGS: -g -O2 -flto=auto -ffat-lto-objects -flto=auto > -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=f

Re: Light weight support for JSON

2022-08-28 Thread Dennis Williamson
On Sun, Aug 28, 2022 at 7:47 PM Dale R. Worley wrote: > The "obvious" way to support Json in Bash would be a utility that parses > Json and produces e.g. a Bash associative array, and conversely a > utility that reads a Bash associative array and produces Json. The real > limitation is that it's

Re: ${!#} doesnt get into history in interactive

2022-08-24 Thread Dennis Williamson
On Wed, Aug 24, 2022, 9:07 AM Alex fxmbsw7 Ratchev wrote: > debian 5.2.0(1)-beta bash > > i did code lightly in interactive > then i did > > set -- 1 2 3 > echo ${!#} > > then arrow up > .. both cmds were skipped , and on the term was rather the old code , which > i previously wrote > > then i di

Re: How come math/arithmetic cannot work by set -x

2022-08-12 Thread Dennis Williamson
On Fri, Aug 12, 2022 at 6:51 PM Budi wrote: > It doesn't work means no use on set -x, no value is shown > > On 8/13/22, Dennis Williamson wrote: > > On Fri, Aug 12, 2022, 6:28 PM Budi wrote: > > > >> How come math/arithmetic ((i=k+l)) cannot make use of set

Re: How come math/arithmetic cannot work by set -x

2022-08-12 Thread Dennis Williamson
On Fri, Aug 12, 2022, 6:28 PM Budi wrote: > How come math/arithmetic ((i=k+l)) cannot make use of set -x > > Please help.. > (so annoying). > It works for me. What are you expecting? It would help if you show what you're doing, the result you're getting and what you expect instead. "It doesn'

Re: $(()): "?:": false "assignment to non-variable"

2022-07-11 Thread Dennis Williamson
On Mon, Jul 11, 2022 at 8:22 AM Chet Ramey wrote: > The normal rules of precedence apply, and the conditional expression on the > rhs of the `:' can't contain an assignment, since the assignment operator > has higher precedence. > > This excerpt from the Bash man page ARITHMETIC EVALUATION sectio

declare +attribute in help

2022-06-29 Thread Dennis Williamson
In help declare it says: Using `+' instead of `-' turns off the given attribute. In the Bash man page it says: Using `+' instead of `-' turns off the attribute instead, with the exceptions that +a and +A may not be used to destroy array variables and +r will not remove the readonly at

Re: Buffer Overflow

2022-04-12 Thread Dennis Williamson
On Tue, Apr 12, 2022, 3:18 PM Sergio Fuentes < fuentes.sergio.nov2...@gmail.com> wrote: > Hello, > > Please, run the following 3 commands to reproduce the bug: > > echo '. ./poc.sh' > poc.sh > chmod +x poc.sh > bash -c './poc.sh' > > The backtrace from gdb: > gdb /bin/bash core > ... > Program ter

Re: [Bug Report] The Unexpected Behavior When Using ANSI Escape Code

2022-03-21 Thread Dennis Williamson
On Mon, Mar 21, 2022 at 4:01 AM Michaelll Lee wrote: > . . . > While using non-printing characters without "\[...\]" proves to be fine in > versions prior to 5.x.x (e.g., many suggestions from some online forums > have suggested "PS1=\e[0m" for using ANSI escape code in the prompt), the > same co

Re: Sus behaviour when cmd string ends with single backslash

2022-02-13 Thread Dennis Williamson
On Sun, Feb 13, 2022, 9:48 PM Robert Elz wrote: > Date:Sun, 13 Feb 2022 21:38:19 -0500 > From:"Dale R. Worley" > Message-ID: <87o83a895w@hobgoblin.ariadne.com> > > | The two a-priori plausable behaviors are for the backslash to be taken > | literally (which i

Re: Incorrect alias expansion within command substitution

2022-02-03 Thread Dennis Williamson
On Thu, Feb 3, 2022, 11:14 AM Alex fxmbsw7 Ratchev wrote: > aliases are the way not to write duplicate code > > No, functions are. >

Re: some unknown bug, says : command not found

2021-11-01 Thread Dennis Williamson
On Mon, Nov 1, 2021, 3:46 PM Greg Wooledge wrote: > On Tue, Nov 02, 2021 at 03:23:15AM +0700, Robert Elz wrote: > > Date:Mon, 1 Nov 2021 12:03:48 -0400 > > From:Greg Wooledge > > Message-ID: > > > > | > bash: : command not found > > | > bash: : command not found

Re: bash git commands ( for noobs like me )

2021-10-22 Thread Dennis Williamson
On Fri, Oct 22, 2021, 8:53 PM Alex fxmbsw7 Ratchev wrote: > could someone share some git wisdom > in preciese few and similiar commands > > show version ( of .git url ) > show available versions > git update tree [ to specific release / version, or newest ] > I'm sure there are lists that provid

Re: Misleading error when attempting to run foreign executable

2021-10-04 Thread Dennis Williamson
On Mon, Oct 4, 2021, 9:09 AM Ilkka Virta wrote: > On Mon, Oct 4, 2021 at 4:46 PM Chet Ramey wrote: > > > Bash reports the error it gets back from execve. In this case, it's > > probably that the loader specified for the executable isn't present on > your > > system. > > > > OTOH, for a script, B

Re: help for needs to mention for ((...))

2021-09-19 Thread Dennis Williamson
On Sun, Sep 19, 2021, 4:07 PM Lawrence Velázquez wrote: > On Sun, Sep 19, 2021, at 3:25 PM, 積丹尼 Dan Jacobson wrote: > > $ help for > > only mentions > >for name [ [ in [ word ... ] ] ; ] do list ; done > > and needs to be updated to mention > >for (( expr1 ; expr2 ; expr3 )) ; do

Re: Interactive commands cant be backgrounded if run from bashrc

2021-09-01 Thread Dennis Williamson
On Wed, Sep 1, 2021, 8:42 PM Greg Wooledge wrote: > On Wed, Sep 01, 2021 at 09:37:02PM -0400, Dale R. Worley wrote: > > "C. Yang" writes: > > > emacs test.txt & > > > > > > fg > > > > > bash: fg: no job control > > > It sounds like Bash doesn't activate the job-control features until > > .bashrc

Re: parameter expansion with `:` does not work

2021-07-07 Thread Dennis Williamson
On Wed, Jul 7, 2021, 7:55 PM wrote: > > > Things are clearer now. > > > > > Seriously, just replace the :- expansion with := and go on with your > code. > > It's the least intrusive change, and won't disturb your logic. > > > > I executed > > > > echo "${parameter:-word}"; echo "${parameter}" >

Re: parameter expansion with `:` does not work

2021-07-07 Thread Dennis Williamson
On Wed, Jul 7, 2021, 4:50 PM wrote: > > Have noticed that parameter expansion with `:` does not work > > > > : ${fltype:-"texi,org"} # alternative to `fltype=` > > $ unset foo $ : ${foo:-bar} $ echo "$foo" $ : ${foo:=bar} $ echo "$foo" bar The first form is a substitution and the second form

Re: Changing the way bash expands associative array subscripts

2021-04-06 Thread Dennis Williamson
On Tue, Apr 6, 2021, 3:09 PM Greg Wooledge wrote: > On Wed, Apr 07, 2021 at 03:53:43AM +0800, konsolebox wrote: > > Also if Bash could just store associative array > > values as a list to preserve store order and stop expanding > > "${array[@]}" based on the sorted order of the keys, then the sli

Re: Likely Bash bug

2021-03-16 Thread Dennis Williamson
. On Tue, Mar 16, 2021, 10:22 PM Lawrence Velázquez wrote: > > On Mar 16, 2021, at 11:08 PM, Dennis Williamson < > dennistwilliam...@gmail.com> wrote: > > > > I've been playing with your optimized code changing the read to grab data > > in chunks like

Re: Likely Bash bug

2021-03-16 Thread Dennis Williamson
On Tue, Mar 16, 2021, 6:19 PM Lawrence Velázquez wrote: > > On Mar 16, 2021, at 6:01 PM, Jay via Bug reports for the GNU Bourne > Again SHell wrote: > > > > Hello, > > > > I have been using/exploring Linux for ~ 2yrs; have corrupted a couple > > systems more than once either through their

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

2020-06-28 Thread Dennis Williamson
On Sun, Jun 28, 2020, 8:50 AM felix wrote: > >_out=$(date -d "$_string" +%s) > many time in same script, I run something like: > > _fifo=$(mktemp -u /tmp/fifo-) > mkfifo $_fifo > exec 9> >(exec stdbuf -o0 date -f - +%s >$_fifo 2>&1) > exec 8<$_fifo > rm $_fifo > >

Re: Backspace echoed incorrectly with TERM=garbage

2020-06-18 Thread Dennis Williamson
On Thu, Jun 18, 2020, 6:03 PM Bryan Henderson wrote: > ... Any ideas on how I could see > the raw character stream sent to a terminal? > > Try the xev program. It will show X events and may reveal the keypresses you're interested in. >

Re: Backspace echoed incorrectly with TERM=garbage

2020-06-17 Thread Dennis Williamson
On Wed, Jun 17, 2020, 5:07 PM wrote: > Configuration Information [Automatically generated, do not change]: > Machine: x86_64 > OS: linux-gnu > Compiler: gcc > Compilation CFLAGS: -g -O2 > -fdebug-prefix-map=/build/bash-2bxm7h/bash-5.0=. -fstack-protector-strong > -Wformat -Werror=format-security

Re: No way to 'bind -x' symbolic character names

2019-11-30 Thread Dennis Williamson
On Sat, Nov 30, 2019, 11:24 AM Chet Ramey wrote: > Readline binds the terminal special characters if the variable > `bind-tty-special-chars' is set, and it's set by default. > Wow, that's been in Bash a long time and I never noticed it! Thanks! >

Re: No way to 'bind -x' symbolic character names

2019-11-30 Thread Dennis Williamson
On Fri, Nov 29, 2019, 10:40 AM Nikolaos Kakouros wrote: > Using bash version: > > GNU bash, version 5.0.11(1)-release (x86_64-pc-linux-gnu) > > > Trying to map Backspace to execute a function, I try to do: > > bind -x '"Rubout": my_func' > > This, as expected, binds the string 'Rubout' to the fun

Re: [readline] Multibyte invisible chars cause weird prompt length calculation issue

2019-11-26 Thread Dennis Williamson
On Tue, Nov 26, 2019, 9:50 AM Алексей Шилин wrote: > В Вт, 26/11/2019 в 07:35 -0600, Dennis Williamson пишет: > > You have printable characters enclosed. For example, \u. _Each_ > > sequence of unprintable characters needs to be separately enclosed > > _without_ enclosi

Re: [readline] Multibyte invisible chars cause weird prompt length calculation issue

2019-11-26 Thread Dennis Williamson
On Tue, Nov 26, 2019, 5:46 AM Алексей Шилин wrote: > В Пн, 25/11/2019 в 18:29 -0800, L A Walsh пишет: > > Multi-byte or not, invisible characters need to be enclosed > > as documented under 'PROMPTING': > > > > \[ begin a sequence of non-printing characters, which could > >

Re: Seg history

2019-10-22 Thread Dennis Williamson
On Tue, Oct 22, 2019, 8:10 AM younes berramdane wrote: > Hello, > I have found a seg in the history of bash while I was doing a project for > my school, > (Put fc -s at the last command of the history file [~/.sh_history] for > bash posix or [~/.bash_history] for bash then launch bash and execute

Re: alias problem -- conflict found

2019-07-12 Thread Dennis Williamson
On Fri, Jul 12, 2019, 3:46 PM L A Walsh wrote: > On 2019/07/12 11:51, Eli Schwartz wrote: > > > find_cmds() { > for c in "$@"; do > type -P $c >&/dev/null || { > Pe "$0#$LINENO: Cannot find %s", "$c" > exit 1; } > alias $c=$(type -P $c); > done > } > > > This is a perfect

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

2019-07-09 Thread Dennis Williamson
>From the bc man page on Ubuntu: This version of bc was implemented from the POSIX P1003.2/D11 draft and contains several differences and extensions rela‐ tive to the draft and traditional implementations. and LANG environment This version does not conform to the POSIX

Re: command "cat /etc/localtime" breaks output on tty-terminal

2019-06-23 Thread Dennis Williamson
On Sun, Jun 23, 2019, 7:18 AM bitfreak25 wrote: > On Sun, 23 Jun 2019 06:04:29 -0500 > Dennis Williamson wrote: > > > On Sun, Jun 23, 2019, 5:31 AM bitfreak25 wrote: > > > > > OS: Arch Linux 5.1.12-arch1-1-ARCH (tty1) > > > Bash-Version: 5.0.7(1)-releas

Re: command "cat /etc/localtime" breaks output on tty-terminal

2019-06-23 Thread Dennis Williamson
On Sun, Jun 23, 2019, 5:31 AM bitfreak25 wrote: > OS: Arch Linux 5.1.12-arch1-1-ARCH (tty1) > Bash-Version: 5.0.7(1)-release > localization: de_DE.UTF-8 UTF-8 > keymap: de-latin1-nodeadkeys > > Description: > The command "cat /etc/localtime" was called in a tty-terminal. After that > some charact

Re: readline: How to unbind _all_ keys

2019-05-21 Thread Dennis Williamson
On Tue, May 21, 2019 at 3:04 AM Henning wrote: > On 20/05/2019 15:38, Chet Ramey wrote: > > On 5/19/19 10:43 AM, Henning wrote: > >> I don't like to have dozens of key bindings I never use. Currently I > >> am issuing lots of lots of bind -r/-u commands to get rid of the > >> default bindings. Th

Re: Handling of Zero-Width escapes in PS1

2019-05-04 Thread Dennis Williamson
On Sat, May 4, 2019, 3:39 PM wrote: > Configuration Information [Automatically generated, do not change]: > Machine: x86_64 > OS: linux-gnu > Compiler: gcc > Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' > -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' > -DCONF_V

Re: info missing in output of declare -a in 4.4.x

2019-02-17 Thread Dennis Williamson
On Sun, Feb 17, 2019, 6:01 PM L A Walsh > > On 2/17/2019 2:19 PM, Dennis Williamson wrote: > > > > So it really is a bug of some sort, not that I use BASH ALIASES > > for anything. Was going to, but ... and you're right, lots of > &

Re: info missing in output of declare -a in 4.4.x

2019-02-17 Thread Dennis Williamson
On Sun, Feb 17, 2019, 3:10 PM L A Walsh > > On 2/16/2019 4:57 AM, Robert Elz wrote: > > Date:Fri, 15 Feb 2019 22:21:25 -0800 > > From:L A Walsh > > Message-ID: <5c67abe5.1030...@tlinx.org> > > > > | Thought about thatrestarted a fresh shell. Same same. > >

Re: in bash 4.4.12,want to verify a behavior...

2019-02-15 Thread Dennis Williamson
On Fri, Feb 15, 2019, 10:46 PM L A Walsh > I printed the various declares using: > > declare -p |& more > > One of the early entries is: > > declare -A BASH_ALIASES=() > > Yet if I type 'alias |& wc, I see 56 lines starting with alias. > > I _thought_ BASH_ALIASES was suppose to hold the aliases >

Re: UUID as Array Keys strangely not possible

2019-01-25 Thread Dennis Williamson
On Fri, Jan 25, 2019, 9:51 PM Robert White On 1/22/19 10:23 PM, Chet Ramey wrote: > > On 1/22/19 3:32 PM, Robert White wrote: > >> Howdy, > >> > >> The following cannot work because, for some reason, the array subscript > >> parser insists on doing math on array indices even when the array is > >>

Re: weird insert of backslashes in strings

2019-01-08 Thread Dennis Williamson
On Tue, Jan 8, 2019, 3:10 PM Configuration Information [Automatically generated, do not change]: > Machine: i686 > OS: linux-gnu > Compiler: gcc > Compilation CFLAGS: -fstack-protector -Wno-parentheses -Wno-format-security > uname output: Linux bongo 2.6.32-042stab134.8 #1 SMP Fri Dec 7 17:16:09 >

Re: "return" should not continue script execution, even if used inappropriately

2019-01-06 Thread Dennis Williamson
On Sat, Jan 5, 2019, 4:05 PM Robert Hailey > To the most excellent bash maintainers: > > I have found, what I consider to be a bug, in the following version of > bash: > * bash-4.4.23-1.fc28.x86_64 > > It is related to this error message: > * "return: can only `return' from a function or sourced s

Re: comment on RFE: 'shift'' [N] ARRAYNAME

2018-09-27 Thread Dennis Williamson
On Tue, Sep 25, 2018, 7:17 PM L A Walsh wrote: > It struck me as it might be convenient if 'shift' could take an optional > arrayname as an argument. Would that be possible or would it cause some > incompatibility? > > i.e. > > > set one two three four five > > dcl -a ARGV=("$@") > > shift AR

Re: weird bash5 bug with ``for i; do echo; done; echo in''

2018-03-24 Thread Dennis Williamson
On Sat, Mar 24, 2018, 12:23 PM Dennis Williamson < dennistwilliam...@gmail.com> wrote: > > > On Sat, Mar 24, 2018, 11:45 AM Clark Wang wrote: > >> Hi Chet, >> >> Today I compiled bash5 (using default configuration) from the devel branch >> (f602026a0ce

Re: weird bash5 bug with ``for i; do echo; done; echo in''

2018-03-24 Thread Dennis Williamson
On Sat, Mar 24, 2018, 11:45 AM Clark Wang wrote: > Hi Chet, > > Today I compiled bash5 (using default configuration) from the devel branch > (f602026a0ce - commit bash-20180316 snapshot) on macOS and found it breaks > one of my rc files. After some time of debugging I have the following > minimal

Re: help shopt: mention what happens if only optnames are given

2017-11-05 Thread Dennis Williamson
On Nov 5, 2017 7:05 PM, "積丹尼 Dan Jacobson" wrote: $ help shopt shopt: shopt [-pqsu] [-o] [optname ...] Set and unset shell options. Change the setting of each shell option OPTNAME. Without any option arguments, list all shell options with an indication of whether or not each is

Re: Bug? Explanation??

2016-12-30 Thread Dennis Williamson
On Dec 30, 2016 11:20 PM, "Peter & Kelly Passchier" < peterke...@passchier.net> wrote: Thanks Dennis and Grisha! I understand. I had thought that every line that is piped into bash is it's own shell alignment, but I understand it's more like sourcing, so these would be more or less equivalent, ri

Re: possible in bash?: filter stderr of a prog & send filtered-output out on stderr leaving stdout untouched

2016-12-06 Thread Dennis Williamson
On Tue, Dec 6, 2016 at 4:09 PM, L A Walsh wrote: > > Is there a way, in bash, to filter stderr and let the > filtered result continue on stderr with the original > stdout being output on stdout? > > with prog being the program to filter, and RE_filt being the > filtering expression, conceptually,

Re: Could bash do what make does?

2016-11-28 Thread Dennis Williamson
On Sun, Nov 27, 2016 at 7:25 PM, Robert Durkacz wrote: > Has thought been given, over the years, to extending bash to do > what make does, in the obvious way that I am about to describe? > > It would be a matter of having chosen build commands do nothing if their > outputs are newer than their in

Re: Unfamiliar; what does this do: "for file do"..."done"

2016-08-13 Thread Dennis Williamson
On Aug 13, 2016 6:36 AM, "L. A. Walsh" wrote: > > I was looking at how the 'ldd' command(bash script) on my system and > came across the code usage: > > for file do ## about line 138 in my version > ... > case $file in > */* : > ;; > *) file=./$file > ;; > esac > ... > done >

Re: readline doesn't refresh properly anymore

2016-06-02 Thread Dennis Williamson
On Jun 2, 2016 11:25 AM, "Charles T. Smith" wrote: > > Hello, > > I moved from ubuntu 10.04 to 14.04 and now readline usually doesn't refresh > my command line when scrolling through my history - the last tokens are often > not shown until I move the cursor there. Is that due to a change in bash?

bash 4.4-rc1 EXECIGNORE not fully working?

2016-03-19 Thread Dennis Williamson
$ type -a ls ls is /bin/ls $ # ls tab completion includes ls $ ls foo foo $ EXECIGNORE=/bin/ls $ type -a ls bash: type: ls: not found $ # ls tab completion does not include ls $ ls foo foo $ /bin/ls foo foo So ls is still executed despite the setting. I tried the same with /usr/bin/find and got th

Re: bash 4.4-rc1 EXECIGNORE not fully working?

2016-03-18 Thread Dennis Williamson
> > > Either EXECIGNORE should block execution or type -a should indicate that its argument matches a pattern in EXECIGNORE. I vote for the latter so a user isn't surprised by execution without a means to identify where it came from. I would also prefer another name. If the purpose is to reduce co

Re: Feature: Easily remove current command from history

2016-01-05 Thread Dennis Williamson
On Mon, Jan 4, 2016 at 4:35 PM, Dennis Williamson < dennistwilliam...@gmail.com> wrote: > > > On Mon, Jan 4, 2016 at 4:05 PM, Dennis Williamson < > dennistwilliam...@gmail.com> wrote: > >> >> >> On Mon, Jan 4, 2016 at 3:07 PM, Eduardo A. Bustamante Lóp

Re: Feature: Easily remove current command from history

2016-01-04 Thread Dennis Williamson
On Mon, Jan 4, 2016 at 4:05 PM, Dennis Williamson < dennistwilliam...@gmail.com> wrote: > > > On Mon, Jan 4, 2016 at 3:07 PM, Eduardo A. Bustamante López < > dual...@gmail.com> wrote: > >> Take into account that many options have been provided (history -d, the

Re: Feature: Easily remove current command from history

2016-01-04 Thread Dennis Williamson
On Mon, Jan 4, 2016 at 3:07 PM, Eduardo A. Bustamante López < dual...@gmail.com> wrote: > Take into account that many options have been provided (history -d, the > space > prefix, even editing .bash_history yourself). > > But you request a single key stroke to do this... why? > > If you enter a pa

Re: Proposed Prompt Escapes

2015-11-17 Thread Dennis Williamson
On Tue, Nov 17, 2015 at 4:16 PM, Ángel González wrote: > While we are talking about new prompt escapes, I would love to be able > to put in the prompt escapes elapsed time values from the previous > command, so prefixing with time(1) could be redundant (if the intended > resource was provided as

Re: Possible bug in getopts when required argument is not supplied

2015-11-13 Thread Dennis Williamson
On Fri, Nov 13, 2015 at 10:13 AM, Griff Miller II wrote: > Configuration Information [Automatically generated, do not change]: > Machine: x86_64 > OS: cygwin > Compiler: gcc > Compilation CFLAGS: -DPROGRAM='bash.exe' -DCONF_HOSTTYPE='x86_64' > -DCONF_OSTYPE='cygwin' -DCONF_MACHTYPE='x86_64-unkno

Re: Proposed Prompt Escapes

2015-11-10 Thread Dennis Williamson
On Tue, Nov 10, 2015 at 12:14 PM, Andreas Schwab wrote: > Dennis Williamson writes: > > > But wait, you don't need the intermediate step! It already works!!! > > > > prompt=$'\u, something about dominoes \U1F061 \@ ' > > You should quote the b

Re: Proposed Prompt Escapes

2015-11-10 Thread Dennis Williamson
On Mon, Nov 9, 2015 at 5:09 PM, Dennis Williamson < dennistwilliam...@gmail.com> wrote: > > > On Thu, Nov 5, 2015 at 6:26 PM, Dennis Williamson < > dennistwilliam...@gmail.com> wrote: > >> It might be handy to have some of the escapes that work in $'stri

Re: ${var@P} expansion includes 0x01 and 0x02

2015-11-09 Thread Dennis Williamson
On Fri, Nov 6, 2015 at 7:51 AM, Chet Ramey wrote: > On 11/5/15 7:45 PM, Dennis Williamson wrote: > > > That's what the \[ and \] escape sequences expand to and use to > > communicate information to readline about invisible characters in the > > promp

Re: Proposed Prompt Escapes

2015-11-09 Thread Dennis Williamson
On Thu, Nov 5, 2015 at 6:26 PM, Dennis Williamson < dennistwilliam...@gmail.com> wrote: > It might be handy to have some of the escapes that work in $'string' > quoting to also work in prompts especially now with the ${parameter@P} > transformation. > > Specifical

Re: ${var@P} expansion includes 0x01 and 0x02

2015-11-05 Thread Dennis Williamson
On Wed, Oct 28, 2015 at 8:55 AM, Chet Ramey wrote: > On 10/27/15 5:02 PM, Greg Wooledge wrote: > > I decided to play around with the ${var@P} expansion in 4.4-beta. > > > > imadev:~$ red=$(tput setaf 1) reset=$(tput sgr0) > x='\[$red\]\u\[$reset\]@\h:\w\$ '; printf %s "${x@P}" | od -t x1 > >

Proposed Prompt Escapes

2015-11-05 Thread Dennis Williamson
It might be handy to have some of the escapes that work in $'string' quoting to also work in prompts especially now with the ${parameter@P} transformation. Specifically the hex, unicode and control ones: \xHH, \u, \U and \cx. I presume that the dollar-single-quote escapes should not b

Re: Paste with null delimiter

2015-11-03 Thread Dennis Williamson
> > Abcs, > Julio > @juliobash > > Próximos cursos de Shell > Cidade Local Período > São Paulo 4Linux 07/12 a 11/12 > Dou treinamento de Shell em qualquer cidade. > Para mais detalhes, me mande um e-mail. > > > 2015-11-03 15:47 GMT-02:00 Dennis Williamson

Re: Paste with null delimiter

2015-11-03 Thread Dennis Williamson
On Tue, Nov 3, 2015 at 10:29 AM, wrote: > An example is better than thousand words: > > $ seq 1 2 9 > odd > $ seq 2 2 10 > even > $ paste -d "" odd even > 12 > 34 > 56 > 78 > 910 > $ paste -d"" odd even > 2 > 4 > 6 > 8 > 10 > > Like you can see, with no space between the option (-d) and the null

Bash 4.4 beta - parameter transformation - parameter attributes

2015-11-02 Thread Dennis Williamson
I considered help-bash for this, but I settled on bug-bash since it's about an in-development version. $ colors=(red green blue) $ printf '%s\n' "${colors[*]@a}" a a a Which is consistent with the documentation: a The expansion is a string consisting of flag values representin

Re: why must bash zap last search string just because we hit ^C?

2015-10-17 Thread Dennis Williamson
On Oct 17, 2015 9:06 PM, "積丹尼 Dan Jacobson" wrote: > > DW> On Fri, Oct 16, 2015 at 1:50 PM, Chet Ramey wrote: > > DW> ^C rudely aborts the entire operation. Why assume you want to save any > DW> of the context? > > Because I got a phone call: the boss asked me to execute a shell > comman

Re: why must bash zap last search string just because we hit ^C?

2015-10-16 Thread Dennis Williamson
On Fri, Oct 16, 2015 at 1:50 PM, Chet Ramey wrote: > On 10/16/15 3:19 AM, 積丹尼 Dan Jacobson wrote: > > Type ^Racb^C^R^R > > (Search backwards for abc, then hit ^C, then try searching backwards > > some more using the last search string.) > > > > My problem is why must bash zap the memory of abc ju

Re: Inconsistent arithmetic evaluation of parameters

2015-09-03 Thread Dennis Williamson
On Thu, Sep 3, 2015 at 8:45 AM, Stephane Chazelas < stephane.chaze...@gmail.com> wrote: > 2015-09-01 16:23:08 -0400, Greg Wooledge: > > On Tue, Sep 01, 2015 at 03:13:57PM -0500, Dennis Williamson wrote: > > > The version of dash I have handy (0.5.7) has math support wh

Re: Inconsistent arithmetic evaluation of parameters

2015-09-02 Thread Dennis Williamson
On Wed, Sep 2, 2015 at 2:16 AM, Andreas Schwab wrote: > Dennis Williamson writes: > > > I disagree. The _expansion_ produced "bar" > > That's not an expansion. Only $ introduces an expansion. > > Andreas. > > The $ is implied. -- Visit serv

Re: Inconsistent arithmetic evaluation of parameters

2015-09-01 Thread Dennis Williamson
On Tue, Sep 1, 2015 at 4:24 PM, Andreas Schwab wrote: > Dennis Williamson writes: > > > $ echo $((foo)) # expansion succeeds, indirection fails > > dash: 4: Illegal number: bar > > The indirection didn't fail, it just didn't produce a number, so the >

Re: Inconsistent arithmetic evaluation of parameters

2015-09-01 Thread Dennis Williamson
On Tue, Sep 1, 2015 at 3:23 PM, Greg Wooledge wrote: > On Tue, Sep 01, 2015 at 03:13:57PM -0500, Dennis Williamson wrote: > > The version of dash I have handy (0.5.7) has math support which IMHO is > > broken: > > > > $ foo=bar > > $ bar=5 > > $ echo $foo

Re: Inconsistent arithmetic evaluation of parameters

2015-09-01 Thread Dennis Williamson
On Tue, Sep 1, 2015 at 12:50 PM, Greg Wooledge wrote: > On Tue, Sep 01, 2015 at 12:50:23AM -0400, Clint Hepner wrote: > > Repeat-By: > > > > foo=bar > > bar=5 > > echo $(( foo ))# produces 5 > > echo $(( foo++ )) # produces 5 > > echo $foo # produces 6, not bar >

Re: bash displays strange characters after base64 decoding

2015-08-06 Thread Dennis Williamson
On Thu, Aug 6, 2015 at 12:45 PM, Valentin Schmidt wrote: > From: v...@posteo.org > To: bug-bash@gnu.org,b...@packages.debian.org > Subject: bash displays strange characters after base64 decoding > > Configuration Information: > Machine: x86_64 > OS: linux-gnu > Compiler: gcc > Compilation CFLAGS:

Re: $() does not handle nesting with case - parser precedence?

2015-06-28 Thread Dennis Williamson
On Sat, Jun 27, 2015 at 2:48 PM, Nathan Neulinger wrote: > Configuration Information [Automatically generated, do not change]: > Machine: x86_64 > OS: linux-gnu > Compiler: gcc > Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' > -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-red

Re: Bug, feature or just the correct behaviour (stat'ing -bash down the PATH)

2015-06-03 Thread Dennis Williamson
On Tue, Jun 2, 2015 at 5:47 PM, Dave Rutherford wrote: > > It is ironic yet somehow appropriate that a fusion energy center > should be having such a 1997 sort of problem today. But > truly, my sympathies. :-) > > Dave > How about a nuclear plant having a '70s kind of problem? https://ca.linke

Re: eval a=b\ c

2015-05-25 Thread Dennis Williamson
I'm trying to put a command in a variable, but the complex cases always fail! : http://mywiki.wooledge.org/BashFAQ/050 Eval command and security issues : http://mywiki.wooledge.org/BashFAQ/048 On Mon, May 25, 2015 at 2:33 PM, wrote: > Configuration Information [Automatically generated, do not c

Re: Problem with brace expansion

2015-04-21 Thread Dennis Williamson
On Tue, Apr 21, 2015 at 2:44 PM, Dr Alun J. Carr wrote: > There appears to be a bug in bash when using a variable in curly brace > expansion, e.g., {1..$n}. I have put the two following test scripts in the > attached files looper1.sh and looper2.sh: > > #looper1.sh > for i in {1..4} > do > ec

Re: Incorrect manage "*" in test -z

2015-04-17 Thread Dennis Williamson
On Fri, Apr 17, 2015 at 8:55 AM, Eduardo A. Bustamante López < dual...@gmail.com> wrote: > > Always quote your variables. The problem comes from > > > > echo $INPUT > > > > which should be > > > > echo $INPUT > > Someone derped. It *should* be > > echo "$INPUT" > > -- > Eduardo Bustamante > https

Re: Incorrect manage "*" in test -z

2015-04-17 Thread Dennis Williamson
On Thu, Apr 16, 2015 at 6:51 PM, Guillermo Buritica Tobon < gburitic...@gmail.com> wrote: > Hi All. > > H have the next bash script code.: > > #!/bin/sh > # Pring OK on empty input, > # Print input on non-empty input > > read INPUT > if [ -z "$INPUT" ]; then > echo OK > else > echo

Re: Documentation Update

2014-12-12 Thread Dennis Williamson
On Fri, Dec 12, 2014 at 12:32 PM, Bob Proulx wrote: > Greg Wooledge wrote: > > David J. Haines wrote: > > > When started interactively, bash sets the extglob shopt; however, that > > > fact seems to have been overlooked in the manpage. > > > > This is a compile-time setting. Your vendor probably

  1   2   3   >