UTF-8 regression in bash 4.2 (from 4.1)

2012-03-18 Thread dennis
DCONF_VENDOR='unknown' -DLOCALEDIR='/usr/local/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -g -O2 uname output: Linux dennis-pc 3.2.6 #3 SMP PREEMPT Tue Feb 21 03:27:27 CET 2012 x86_64 AMD Phenom(tm) II X6 1100T Process

Inconsistent results when history -s is used within PROMPT_COMMAND

2009-06-11 Thread dennis
Configuration Information [Automatically generated, do not change]: Machine: i486OS: linux-gnuCompiler: gccCompilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash

Re: Inconsistent results when history -s is used within PROMPT_COMMAND

2009-06-17 Thread dennis
evious entry as part of a compound command. Thanks for clarifying. Dennis From: "Chet Ramey" Sent: Tuesday, June 16, 2009 8:38 PM To: den...@netstrata.com Subject: Re: Inconsistent results when history -s is used within PROMPT_COMMAND This is t

PROMPT_DIRTRIM skips depth n-1 when ~ is n

2009-11-28 Thread dennis
Configuration Information [Automatically generated, do not change]:Machine: i486OS: linux-gnuCompiler: gccCompilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' -DCONF_OSTYPE='lin$uname output: Linux emperor 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:04:2$Machine Type: i486-pc-linux-g

Problems when RANDOM without $ is used as an array index

2010-01-09 Thread dennis
Configuration Information [Automatically generated, do not change]: Machine: i486 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='ba

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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: [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: 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

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: $(()): "?:": 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

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: 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: ${!#} 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: 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: 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: 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: 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 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: 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 >

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: 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: 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: 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: 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)

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: 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: 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: [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: 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: 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` >

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: 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/ >

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: "${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

Negative or zero arguments to yank-last-arg in bound keystrokes

2010-11-08 Thread Dennis Williamson
Configuration Information [Automatically generated, do not change]: Machine: i686 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/local/share/locale' -DPACKAGE

Re: Bash History Files

2010-11-09 Thread Dennis Williamson
See http://stackoverflow.com/q/103944/26428 On Tue, Nov 9, 2010 at 12:58 AM, Ajay Jain wrote: > Hi, > > I use bash via Xterm. As a result I open multiple Xterm windows. When > I type commands on the shell, they get saved only for that particular > shell's history. I want to be able to collate tha

Re: Issue with Getopts

2010-11-14 Thread Dennis Williamson
It would be helpful if you posted the error message. When you say normally, I assume you mean bash -c script.sh Most likely the first line of your script is something other than: #!/bin/bash On Mon, Nov 15, 2010 at 1:11 AM, Ajay Jain wrote: > Hi, > > I use 'getopts' in my shell script. If I r

Re: quote nesting bug

2010-11-19 Thread Dennis Williamson
I get $PS2 prompts for either of the single or double quote versions in Bash 3 and 4. In ksh93 and zsh 4.3.10, the single quote version works for me, but the double quote version produces a continuation prompt. So my results differ from yours quite a bit. On Fri, Nov 19, 2010 at 12:20 PM, Matt Z

Compiling Bash 2.05b (patched) gives error: label at end of compound statement [solved]

2010-11-22 Thread Dennis Williamson
Compiling Bash 2.05b with seven patches applied. malloc.c: In function ‘internal_free’: malloc.c:881: error: label at end of compound statement make[1]: *** [malloc.o] Error 1 Adding a semicolon on the line after this label satisfies the picky gcc 4.4.1 (actually since 3.4?). This is just FYI fo

blink-matching-paren doesn't blink

2010-11-22 Thread Dennis Williamson
When I do bind -v one of the settings I see is set blink-matching-paren on but I don't get any blinking when I type closing parentheses at the command line. If I do bind 'set blink-matching-paren on' or have set blink-matching-paren on in my ~/.inputrc explicitly, then it works. Why does

Re: blink-matching-paren doesn't blink

2010-11-22 Thread Dennis Williamson
ow it got (half) enabled. On Mon, Nov 22, 2010 at 3:18 PM, Chet Ramey wrote: > On 11/22/10 3:36 PM, Dennis Williamson wrote: >> When I do >> >> bind -v >> >> one of the settings I see is >> >> set blink-matching-paren on > > It's not supposed to

Re: Compiling Bash 2.05b (patched) gives error: label at end of compound statement [solved]

2010-11-22 Thread Dennis Williamson
Some systems still use older versions. It's useful to be able to have access to them when working away from the target system. On Mon, Nov 22, 2010 at 7:56 PM, Clark J. Wang wrote: > On Tue, Nov 23, 2010 at 1:33 AM, Dennis Williamson > wrote: >> >> Compiling Bash 2

Re: echo "${HOME#$*/}" segfaults

2010-12-01 Thread Dennis Williamson
But not when $* is not empty: $ set -- foo $ echo "${HOME#$*/}" /home/username On Tue, Nov 30, 2010 at 7:43 PM, David Rochberg wrote: > Configuration Information [Automatically generated, do not change]: > Machine: x86_64 > OS: linux-gnu > Compiler: gcc > Compilation CFLAGS:  -DPROGRAM='bash' -D

Re: Clear Screen

2010-12-01 Thread Dennis Williamson
PuTTY and gnome-terminal seem to preserve the previous output in the scrollback buffer (effectively doing a "newline" clear). PuTTY has a setting for this: "Window/Push erased text into scrollback" On Wed, Dec 1, 2010 at 3:21 PM, Greg Wooledge wrote: > On Wed, Dec 01, 2010 at 02:04:51PM -0700, B

Re: Negative or zero arguments to yank-last-arg in bound keystrokes

2010-12-06 Thread Dennis Williamson
On Mon, Dec 6, 2010 at 7:29 PM, Chet Ramey wrote: > On 12/6/10 8:22 PM, Chet Ramey wrote: > >> Yes.  In this case, the documentation is less than clear.  The count >> argument is actually set by the first call to yank-last-arg, and that >> argument sets the word to extract from the history entry.

Re: comparison inside [[]] is not numeric comparison?

2010-12-09 Thread Dennis Williamson
On Fri, Nov 19, 2010 at 6:45 PM, john.ruckstuhl wrote: > In bash, a comparison inside "[["/"]]" is lexicographic not numeric? > This isn't what I expected. > Which part of the documentation would set me straight?  If someone > could quote the fine manual, that would be great. > > $ if [[ 2000 > 20

Re: comparison inside [[]] is not numeric comparison?

2010-12-09 Thread Dennis Williamson
On Thu, Dec 9, 2010 at 10:48 AM, Dennis Williamson wrote: > On Fri, Nov 19, 2010 at 6:45 PM, john.ruckstuhl > wrote: >> In bash, a comparison inside "[["/"]]" is lexicographic not numeric? >> This isn't what I expected. >> Which part of the

Re: Encoding oddity

2010-12-09 Thread Dennis Williamson
On Thu, Dec 9, 2010 at 7:11 PM, Richard wrote: > Hi! > > OS X 10.6.x > > I am trying to loop over some files with extended characters. > Everything works fine if I hardcode the path, see example 1, > but if I use a for loop with a * wildcard, I get some problems, > see example 2. > > The problems

Re: Encoding oddity

2010-12-10 Thread Dennis Williamson
On Fri, Dec 10, 2010 at 2:04 AM, Richard wrote: > Hi! > > On 10. des. 2010, at 06.26, Dennis Williamson wrote: > >>> -- >>> #!/bin/bash >>> >>> touch /Users/myuser/pretérito.txt >>> >>> # E

Re: Minor documentation suggestion: while/until

2010-12-22 Thread Dennis Williamson
In this context, "list" represents a syntactic element rather than a literal variable. If you read the section above, titled "Lists", you'll see: Lists A list is a sequence of one or more pipelines separated by one of the operators ;, &, &&, or ⎪⎪, and optionally terminated by one

Re: how to escape single quote?

2010-12-29 Thread Dennis Williamson
On Wed, Dec 29, 2010 at 1:28 AM, ali hagigat wrote: > I wonder if anybody knows how to escape a single quote character by > /bin/sh or bash? > echo 'ppp\'qqq'' > ppp\qqq > Please look at the above example and the result. > Regards > > echo "ppp'qqq" or echo 'ppp'\''qqq'

Re: Command substitution (backtick) and tab completion

2010-12-31 Thread Dennis Williamson
You can get similar results: `shell-expand-line (M-C-e)' Expand the line as the shell does. This performs alias and history expansion as well as all of the shell word expansions (*note Shell Expansions::). http://tiswww.case.edu/php/chet/bash/bashref.html#SEC115 On my system that

Re: Bug in shell: buffer overflow.

2011-01-01 Thread Dennis Williamson
On my 32-bit system in Bash: $ printf '%u\n' -1 18446744073709551615 $ echo $((2**63-1)) 9223372036854775807 $ echo $((2**63)) -9223372036854775808 On Sat, Jan 1, 2011 at 11:48 AM, Stephane CHAZELAS wrote: > 2010-12-31, 11:33(-07), Bob Proulx: > [...] >> Your expressions above are overflowing th

Re: assertion botched

2011-01-01 Thread Dennis Williamson
On Mon, Dec 27, 2010 at 6:17 AM, chloe wrote: > Configuration Information [Automatically generated, do not change]: > Machine: i486 > OS: linux-gnu > Compiler: gcc > Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' > -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu' > -DC

Re: read builtin and readonly variables

2011-01-03 Thread Dennis Williamson
On Tue, Jan 4, 2011 at 12:41 AM, Jan Schampera wrote: > Hello list, > > > the read builtin command, when trying to assign to a readonly variable after > reading the data, spits an error message. This is fine. > > But the return status is 0. It "always" (down to 2.04 was tested) has been > like tha

Re: 'help set' missing '--'

2011-01-10 Thread Dennis Williamson
On Mon, Jan 10, 2011 at 2:06 AM, Chris F.A. Johnson wrote: > On Mon, 10 Jan 2011, Jan Schampera wrote: > > the help output for the set builtin command misses '--'. >> > > It's there: > > SYNOPSIS >set [--abefhkmnptuvxBCHP] [-o option-name] [arg ...] > > -- > Chris F.A. Johnson,

Re: set -m +m -x and the element of chance or is it race conditions?

2011-01-28 Thread Dennis Williamson
On Fri, Jan 28, 2011 at 9:11 PM, wrote: > I isolated the problem and submitted > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=611417 which I forget > to X-Debbugs-cc to bash-...@gnu.org, which I should have, as it probably > is a upstream problem that only the bash authors can fix. > > In you

Re: How can i specify the scripting language used for parsing a script?

2011-02-05 Thread Dennis Williamson
On Sat, Feb 5, 2011 at 6:57 AM, ali hagigat wrote: > #!/bin/sh > echo ppp > echo $SHELL > exit 2200 > > In the above script i tried to specify /bin/sh as my parser by a > comment. Is that OK? When I type ./scr2 , i want bash recognize > /bin/sh as the parser of ./scr2. > > exit only works with

Proposed enhancement to bind builtin

2011-02-05 Thread Dennis Williamson
As far as I know, there is currently no way to display shell-command key bindings. I would like to propose that bind -x and bind -X without additional arguments perform this function in a manner parallel to -[sSvVpP].

Re: No Color for Bash Completion Results

2011-02-05 Thread Dennis Williamson
On Sat, Feb 5, 2011 at 1:35 PM, Roger wrote: > When using bash completion on files within local folder, ie. "$ ls f" > showing results for files starting with char "f" -- or any char(s) you may > specify, results are not provided in color when bash, terminal and ls are > configured for using color

Re: multi-line commands in the history get split when bash is quit

2011-02-07 Thread Dennis Williamson
On Sun, Feb 6, 2011 at 5:14 PM, Slevin McGuigan wrote: > Hi all, > > wow, that was much very much information. Thanks for all the hints and the > discussion. Please apologize when I missed something in one of your > comments... > > My ideas/comments on what some of you wrote > > Michael Witten wro

Re: Can someone explain this?

2011-02-11 Thread Dennis Williamson
On Fri, Feb 11, 2011 at 9:21 PM, Jon Seymour wrote: > Correction - a _leading_ cd command and only a leading cd command, > seems to be completely ignored in the case I described. > > Why is this? > > jon. > > -- Forwarded message -- > From: Jon Seymour > Date: Sat, Feb 12, 2011 at

Re: Can someone explain this?

2011-02-11 Thread Dennis Williamson
'echo\ \$\$\ \$PPID' ';' echo '$$' > 11553 11552 > 11552 > > bash is invoked with: > '-c' > 'echo $$ $PPID' > > then: > > echo $$ runs in the parent shell > > jon. > > > On Sat, Feb 12, 2011 at 2:44 PM, Dennis W

Re: how to workaroun 'nl' being added to input-line after 49 characters....

2011-02-13 Thread Dennis Williamson
On Sun, Feb 13, 2011 at 3:50 PM, Linda Walsh wrote: > I'm having a problem, I think,  due to my setting the prompt in > 'root' mode, to a different color.  This results in me being able to > enter only 49 characters on the input line before it wraps to the next > line. > > I add an open and close

compat31

2011-02-14 Thread Dennis Williamson
I'm having a discussion with someone who claims that for them on Bash 4.0.33, with compat31 *off*, they are getting 3.1 behavior with quoted patterns in a =~ match. They're saying that this: [[ a =~ "." ]] && echo match || echo no results in "match". I cannot reproduce this without doing shopt

Re: how to workaroun 'nl' being added to input-line after 49 characters....

2011-02-14 Thread Dennis Williamson
On Mon, Feb 14, 2011 at 12:34 PM, Linda Walsh wrote: > > For completeness current code (haven't fixed the DISPLAY part yet): > > if [ -n "$_sh_interactive_shell" ] ; then       shopt -s cdspell checkhash > checkwinsize cmdhist dotglob extglob         shopt -s histappend > hostcomplete lithist >  

Re: compat31

2011-02-14 Thread Dennis Williamson
On Mon, Feb 14, 2011 at 9:14 AM, Greg Wooledge wrote: > On Mon, Feb 14, 2011 at 09:03:34AM -0600, Dennis Williamson wrote: >> I'm having a discussion with someone who claims that for them on Bash >> 4.0.33, with compat31 *off*, they are getting 3.1 behavior with quoted >&

Re: compat31

2011-02-15 Thread Dennis Williamson
On Tue, Feb 15, 2011 at 8:45 AM, Roman Rakus wrote: > On 02/14/2011 04:03 PM, Dennis Williamson wrote: >> >> I'm having a discussion with someone who claims that for them on Bash >> 4.0.33, with compat31*off*, they are getting 3.1 behavior with quoted >> patt

Bash 4.2 printf %()T seems to ignore TZ

2011-02-15 Thread Dennis Williamson
When I ran make test I noticed a discrepancy in a couple of the times output during the printf tests. I pulled out the relevant section and this is what I get: LC_ALL=C LANG=C SECS=1275250155 export TZ=EST5EDT printf "%()T\n" $SECS printf "%(%e-%b-%Y %T %Z)T\n" $SECS # added %Z result: 15:09:15

Re: [bash4.2] ${v//[/} bug?

2011-02-15 Thread Dennis Williamson
On Tue, Feb 15, 2011 at 9:16 PM, Clark J. Wang wrote: > On Wed, Feb 16, 2011 at 9:59 AM, Chet Ramey wrote: > >> On 2/15/11 6:18 AM, Clark J. Wang wrote: >> > For following script: >> > >> > var='[hello' >> > echo "${var//[/}" >> > >> > With bash 4.1 it outputs hello but with 4.2 it outputs [hello

Re: [bash4.2] ${v//[/} bug?

2011-02-15 Thread Dennis Williamson
On Tue, Feb 15, 2011 at 9:54 PM, Dennis Williamson wrote: > On Tue, Feb 15, 2011 at 9:16 PM, Clark J. Wang wrote: >> On Wed, Feb 16, 2011 at 9:59 AM, Chet Ramey wrote: >> >>> On 2/15/11 6:18 AM, Clark J. Wang wrote: >>> > For following script: >&g

Re: Bash 4.2 printf %()T seems to ignore TZ

2011-02-16 Thread Dennis Williamson
On Wed, Feb 16, 2011 at 7:22 AM, Greg Wooledge wrote: > On Tue, Feb 15, 2011 at 09:49:16PM -0600, Dennis Williamson wrote: >> SECS=1275250155 >> export TZ=EST5EDT >> printf "%()T\n" $SECS >> printf "%(%e-%b-%Y %T %Z)T\n" $SECS  # added %Z >>

Re: Patch: Corrupt display for history search in vi-mode, 256-color prompt

2011-02-22 Thread Dennis Williamson
2011/2/22 Micah Cowan : > This bug affects both readline and bash (however, it is expected that > this bug is far more likely to affect bash than other typical > readline-using applications). It was experienced on bash 4.1-2ubuntu4 > (on Ubuntu 10.10, "Maverick Meercat"), but I checked the sources

Re: Negative array subscript with unset

2011-03-12 Thread Dennis Williamson
On Sat, Mar 12, 2011 at 6:21 PM, Chris F.A. Johnson wrote: > >  I all versions I have tried, unsetting an array element using a >  negative index fails: > > $ array=( q w e r t y ) > $ unset 'array[-1]' > bash: [-1]: bad array subscript > > > -- >   Chris F.A. Johnson, >  

Re: How to do? Possible?

2011-07-25 Thread Dennis Williamson
On Mon, Jul 25, 2011 at 4:45 PM, Linda Walsh wrote: > > > Linda Walsh wrote: >> >> Bob Proulx wrote: >>> Yes, but it is a fork(2) of the parent shell and all of the variables >>> from the parent are copied along with the fork into the child process >>> and that includes non-exported variables.  No

Re: How to do? Possible?

2011-07-25 Thread Dennis Williamson
Sorry, I overlooked the indirection (and the missing semicolon). On Mon, Jul 25, 2011 at 10:18 PM, Bob Proulx wrote: > Dennis Williamson wrote: >> Linda Walsh wrote: >> > GLOBAL="hi there" >> > {foo=GLOBAL echo ${!foo}; } > > Note that this tickles a

Re: bug: return doesn't accept negative numbers

2011-08-05 Thread Dennis Williamson
return (and exit) returns an exit code between 0 and 255. Zero means true and anything else means false If you want a function to "return" a value, use printf or echo. On Fri, Aug 5, 2011 at 6:41 PM, Linda Walsh wrote: > > > > I guess I don't use negative return codes that often in shell, but >

Re: Inline `ifdef style` debugging

2011-08-08 Thread Dennis Williamson
On Mon, Aug 8, 2011 at 3:47 AM, Roger wrote: > I'm doing some research for one of my scripts and always liked the C style > ifdef inline debug statements. > > The following script seems to work just fine when using the "echo" command > instead of the currently used "printf" command. > > When using

Is bash dying or dead (was Re: 4.1 is "$((( ))) an 'official operator, if $(( )) isn't?

2011-08-10 Thread Dennis Williamson
> > I thought the $( ) was necessary to make the inner (()) an arithmetic > expression...  Does it execute in a sub process? > No, $( ) is for process substitution, $(( )) is for an arithmetic context. I normally (in Bash), use (( )) outside the whole expression since it gives me complete freedom

Re: Syntax Question...

2011-08-13 Thread Dennis Williamson
On Sat, Aug 13, 2011 at 6:41 PM, Linda Walsh wrote: > > > > I want to have an array of  'names'. > > given a name, "X", I had a prefix, _p_, so have _p_X, > I want to access / manipulate it as an array. > > so given I pass in a name in a var, I have to use 'indirect' syntax: > > ${!name} > > But t

Re: Syntax Question...

2011-08-14 Thread Dennis Williamson
On Sun, Aug 14, 2011 at 6:31 PM, Linda Walsh wrote: > > > Re:   BashFAQ/006: http://mywiki.wooledge.org/BashFAQ/006 > Pierre Gaston wrote: >> >> Linda: >> >> >>> >>> please show quote the section >>> that shows using an variable that holds the name of an array to be used >>> (and assigned to)

Re: Syntax Question...

2011-08-14 Thread Dennis Williamson
e conditions. Please show some code. On Sun, Aug 14, 2011 at 10:15 PM, Linda Walsh wrote: > > > > ` Dennis Williamson wrote: >> >> On Sun, Aug 14, 2011 at 6:31 PM, Linda Walsh wrote: >> >>>>> >>>>> please show quote the sec

Re: Syntax Question...

2011-08-15 Thread Dennis Williamson
On Mon, Aug 15, 2011 at 2:45 AM, Linda Walsh wrote: > > > > ` Linda Walsh wrote: >> >> The latest error I got is a a simple type -- most of them probably are, >> with that many >> lines of code in ~3-4 weeks, there's bound to be -- trouble is I'm >> stubborn sometimes >> about 'punishing myself''

Re: Syntax Question...

2011-08-16 Thread Dennis Williamson
On Mon, Aug 15, 2011 at 10:19 PM, Linda Walsh wrote: > > >> >> How do I determine the location of my script? >> http://mywiki.wooledge.org/BashFAQ/028 >> > > ???  I don't understand the need for complexity -- what I have works.  Its a > few > lines@ most -- I use the same in perl.  has worked for

Re: Syntax Question...

2011-08-16 Thread Dennis Williamson
On Tue, Aug 16, 2011 at 11:45 AM, Ken Irving wrote: > > I'm guessing the 'Ack!' was maybe for 'useless use of subshell'? > > No, it was for the ls. -- Visit serverfault.com to get your system administration questions answered.

Re: Syntax Question...

2011-08-16 Thread Dennis Williamson
On Tue, Aug 16, 2011 at 4:11 PM, Linda Walsh wrote: > > > > Dennis Williamson wrote: >> > >   Who's Greg?  I mean before some days ago and other than seeing the name on > this list, who is he from Adam that someone should think his FAQ is > important? >

Re: BASH_SUBSHELL count not counting?

2011-08-29 Thread Dennis Williamson
On Mon, Aug 29, 2011 at 7:24 PM, Roger wrote: > > Within GNU Screen session & VTE: > > roger@localhost2 ~ $ bash > > 0 ;-) > roger@localhost2 ~ $ ps -ax |tail > Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html > 30840 pts/6    Ss     0:00 /bin/bash - /home/roger/bin/b

Re: BASH_SUBSHELL count not counting?

2011-08-29 Thread Dennis Williamson
By the way, you might find ps fx to be more useful in this case. On Mon, Aug 29, 2011 at 7:24 PM, Roger wrote: > > Within GNU Screen session & VTE: > > roger@localhost2 ~ $ bash > > 0 ;-) > roger@localhost2 ~ $ ps -ax |tail > Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf

Re: Purge History of rm commands

2011-09-20 Thread Dennis Williamson
On Tue, Sep 20, 2011 at 1:34 AM, Roger wrote: >> On Mon, Sep 19, 2011 at 08:38:44AM -0400, Greg Wooledge wrote: >>On Sun, Sep 18, 2011 at 10:11:17PM -0800, Roger wrote: >>> > On Mon, Sep 19, 2011 at 01:37:22AM -0400, Mike Frysinger wrote: >>> >On Monday, September 19, 2011 01:18:02 Roger wrote: >>

  1   2   3   >