Re: Exclamation mark does not work with set -e

2020-04-06 Thread Chris Down
f...@florentbordignon.fr writes: The following assertion succeeds when it should not : set -e ! true echo Hello # prints Hello but should not Please do read the documentation before reporting bugs :-) If you read the documentation for `-e`, you'll see that if the command is being inverted wit

Re: performance bug of [[ $x ]]

2020-03-07 Thread Chris Down
Peng Yu writes: Could you show me how you do the profiling for this specific case? Based on what proof that you can conclude that it is not the `[[` performance problem? Like I said, `perf` is perfectly adequate. bash -c 'x=$(printf "%.sx" {1..1000}); perf record -g -p $$ & sleep 2; t

Re: performance bug of [[ $x ]]

2020-03-07 Thread Chris Down
Peng Yu writes: [[ $x ]] just tests whether the variable $x is of length 0 or not. So its performance should not depend on how long the variable is. Who said it has anything to do with the [[ builtin's performance? A shell does a lot more than just running one command. For this and the last

Re: Change in SIGTERM behaviour in bash 4.3 when using readline

2020-03-04 Thread Chris Down
Chris Down writes: I'm not quite sure how best to handle this, maybe setting SIG_IGN as the default signal handler for interactive shells if there's nothing to inherit? This is one of those cases where SA_RESTART doesn't quite mimic SIG_IGN... This seems too simple, so I assum

Re: Change in SIGTERM behaviour in bash 4.3 when using readline

2020-03-04 Thread Chris Down
Ah, it's been a while since I did this and I forgot about the granularity of the devel branch :-) There it bisects to 73a146bec7f75da9f78f6d54329c980b75a2318d ("commit bash-20130215 snapshot"). I'm pretty sure it's related to this change to add the signal handler inside initialize_shell_signal

Change in SIGTERM behaviour in bash 4.3 when using readline

2020-03-04 Thread Chris Down
Hi there, A question on Unix & Linux Stack Exchange[0] brought up the question of SIGTERM terminating interactive bash shells. This surprised me, and after bisecting I narrowed it down to commit ac50fbac ("Bash-4.3 distribution sources and documentation"). Going through the commit I see a si

Re: Multiline prompt problems with long commands

2014-11-04 Thread Chris Down
Kamil Neczaj writes: Thank you for your response! I modified this prompt couple of times, probably that's why it's like this. Anyway, I don't think this should cause the problem. The PS1 variable is the one I use. I wanted to copy it here to have exactly the example which I know that causes probl

Re: SEGFAULT if bash script make "source" for itself

2014-08-28 Thread Chris Down
bogun.dmit...@gmail.com writes: O... you have more serious bugs Than fixing a segfault that occurs when the user is obviously doing something stupid? Sure.

Re: SEGFAULT if bash script make "source" for itself

2014-08-28 Thread Chris Down
bogun.dmit...@gmail.com writes: And what for this mailing list? Don't answer, this have no any sense any more. This mailing list is for reporting bugs. So far nobody thinks that what you reported is a bug, so you would essentially be making a feature request. If you want to prioritise that, i

Re: SEGFAULT if bash script make "source" for itself

2014-08-28 Thread Chris Down
bogun.dmit...@gmail.com writes: Is it so heavy to check length of $BASH_SOURCE array? Adding artificial barriers that don't actually solve the problem are "heavy" in terms of technical debt, even if not code.

Re: SEGFAULT if bash script make "source" for itself

2014-08-28 Thread Chris Down
I really don't understand -- why is this unexpected? It's exactly what I'd expect to happen if you try to do something like that. It should not be disallowed to source yourself, that prevents people from doing things when *sensibly* sourcing their own script.

Re:

2014-07-16 Thread Chris Down
Hi Tran, I think you've misunderstood the intent of Chet's reply. Nobody disagrees that the RSS should not increase. The reason that you're being asked for valgrind output is because the problem has yet to be reproduced, and the valgrind output might shed some light on where the problem lies,

Re: umask --help

2014-07-07 Thread Chris Down
Hi Jon, As is standard with other buitins, umask is documented at `help umask`: chris@gopher:~$ help umask umask: umask [-p] [-S] [mode] Display or set file mode mask. Sets the user file-creation mask to MODE. If MODE is omitted, prints the current value

Re: typo in bashbug.sh of bash-4.3

2014-06-16 Thread Chris Down
Chris Down writes: > What makes you think that that is a "typo" and not just some spacing > that is other than your preference? That syntax (with or without > spacing) is perfectly legal when referencing a descriptor. Apparently I forgot that's a zsh feature, not a POS

Re: typo in bashbug.sh of bash-4.3

2014-06-16 Thread Chris Down
What makes you think that that is a "typo" and not just some spacing that is other than your preference? That syntax (with or without spacing) is perfectly legal when referencing a descriptor. pgpSOER74XdS5.pgp Description: PGP signature

Re: Expansion of exclamation mark in single quotes in subcommand

2014-04-21 Thread Chris Down
Chris Down writes: > !! is not single-quoted in the ultimate expansion (bash knows nothing > about what happens inside the subshell), which is all that matters. It's > not too late to perform history expansion (which is different than > parameter expansion). To be more c

Re: Expansion of exclamation mark in single quotes in subcommand

2014-04-21 Thread Chris Down
Maxdamantus writes: > It's not just inside a double-quoted block. It's inside a single-quoted block. No, your ultimate expansion is in a double quoted block. What happens inside the command substitution does not matter. > The last two commands in my first email demonstrate that the $ > expansion

Re: Expansion of exclamation mark in single quotes in subcommand

2014-04-21 Thread Chris Down
Maxdamantus writes: > This seems like a bug, but it seems to have been here for a few years > (from the git repository, bash-3.0 displays this behaviour while > bash-2.05b doesn't). > > With history expansion enabled (set +H): > > $ echo '!!' # good > !! > $ echo "$(echo '!!')" # not good; !! exp

Re: UTF-8 printf string formating problem

2014-04-05 Thread Chris Down
Jan Novak writes: > printf string format counts bytes instead of chars, which leads to > broken output According to POSIX, printf's field width control is strictly in bytes, not characters.[0] > field width: > An optional string of decimal digits to specify a minimum field > width. For a

Re: /dev/fd/62: No such file or directory

2014-04-05 Thread Chris Down
Linda Walsh writes: > Pattern matching? Why doesn't '*' match anything then? I've no idea what you're doing, but: $ var='*bar*' $ [[ abarb = $var ]] $ echo $? 0 $ [[ aquxb = $var ]] $ echo $? 1 pgpUZ39g3TPmc.pgp Description: PGP signature

Re: /dev/fd/62: No such file or directory

2014-04-05 Thread Chris Down
Linda Walsh writes: > So all I need do is test the first entry: > >local -a entries=("$1"/*) >[[ ${entries[0]} == $1/* ]] && return 0 > > --- the $1 doesn't need quotes in [[]] and '*' won't expand or > am missing something? Thanks for the tip Pierre, I often > don't see forests because

Re: ls doesn't work in if statements in bash 4.3

2014-03-27 Thread Chris Down
billyco...@gmail.com writes: > > huge wall of text First of all, please follow basic etiquette and trim your quotes to what is relevant. I can't even fit your e-mail on my entire screen. > On one hand I realize you think you're being helpful to someone who > has just started bash programming, but

Re: multiline ^C regression

2014-03-27 Thread Chris Down
Egmont Koblinger writes: > Sorry, I wasn't clear enough. > > By "multiline" I mean a simple command that is so long (e.g. takes so many > parameters) that it cannot fit into a single line. (You reach the right > margin of your terminal and keep on typing.) I can reproduce that, and the subsequen

Re: multiline ^C regression

2014-03-27 Thread Chris Down
Egmont Koblinger writes: > Type a multiline command, and press ^C. > > bash-4.2: The new prompt appeared below the complete multiline command. > > bash-4.3: The new prompt appears right under the previous prompt, > overwriting parts of the aborted command line and leaving garbage after the > ne

Re: printf cannot write more than one line to /proc/pid/uid_map

2014-03-25 Thread Chris Down
Chet Ramey writes: > `command' is a shell builtin that will run shell builtins. It only skips > shell functions. Huh, I guess I have been using zsh for too long. I forgot that the behaviour in bash/POSIX is not the same. pgpYBta6iEqrR.pgp Description: PGP signature

Re: printf cannot write more than one line to /proc/pid/uid_map

2014-03-25 Thread Chris Down
Pádraig Brady writes: > If you want to use the external printf to achieve more > standard buffering modes, you can use `env` like: > > env printf '%s' '0 0 1\n1 1 1' > /proc/31861/uid_map While this will probably work, the more typical way to do this is with command(1P). pgpOycint6nTB.pgp Des

Re: When a hashed pathname is deleted, search PATH

2014-03-19 Thread Chris Down
Linda Walsh writes: > If this was a reactor control program, that's one thing, but in > deciding what solution to implement to save some small lookup time or > throw it away, an 90% solution is probably fine. It's called a > heuristic. AI machines use them. Thinking people use them. Why > shoul

Re: typo in bash manual

2014-03-02 Thread Chris Down
On 2014-03-02 06:30:07 -0800, Ryan Cunningham wrote: > Apparently I am not reading it wrong. Read my previous e-mail to this > list on this thread. If you had paid attention and looked at my reply more closely, you would have noticed that the e-mail was not even addressed to you, it was addressed

Re: typo in bash manual

2014-03-01 Thread Chris Down
On 2014-03-01 11:29:03 -0800, Dave Yost wrote: > In http://www.gnu.org/software/bash/manual/bashref.html#GNU-Parallel > > Where you say > ls *.gz | parallel -j+0 "zcat {} | bzip2 >{.}.bz2 && rm {}" > This will recompress all files in the current directory with names ending in > .gz using bzip2, r

Re: Hitting C-c C-c in Emacs' *shell* causes segmentation fault

2014-02-06 Thread Chris Down
On 2014-02-06 22:16:56 -0500, Chet Ramey wrote: > OK, I'll bite. What is C-c C-c supposed to do? It looks like it just > spews a bunch of garbage to your screen. Is that the intent? According to the Emacs manual[0]: > Interrupt the shell or its current subjob if any > (comint-interrupt-subjob)

Re: Associative array assignment crashes Bash interpreter

2014-02-03 Thread Chris Down
On 2014-02-03 08:52:20 -0500, Chet Ramey wrote: > I'm going to assume from the date and the Received: headers that this is > just a case of a mail queue getting flushed. The message looks like it > sat in a queue for around 50 days. Ah, I didn't see the date on the original mail. My bad. pgpbZ4

Re: Associative array assignment crashes Bash interpreter

2014-02-02 Thread Chris Down
First of all, please fix your broken From header. It should be b...@franklin.gtkcentral.net when you are addressing the wider Internet, not ben@franklin. On 2013-12-13 05:25:17 -0500, ben@franklin wrote: > Description: > The included scripts generate a "division by zero" and "recursion level

Re: let's establish BASH_MINIMUM_TIME_BETWEEN_INTERACTIVE_COMMAND

2014-01-29 Thread Chris Down
On 2014-01-29 21:03:12 -0700, Bob Proulx wrote: > Eduardo A. Bustamante López wrote: > > Chris Down wrote: > > > Well, you can do this with PROMPT_COMMAND='sleep 1'. I don't see the > > > need for another internal variable to do this. > > > >

Re: let's establish BASH_MINIMUM_TIME_BETWEEN_INTERACTIVE_COMMAND

2014-01-29 Thread Chris Down
On 2014-01-30 09:18:19 +0800, jida...@jidanni.org wrote: > So let's establish BASH_MINIMUM_TIME_BETWEEN_INTERACTIVE_COMMAND=1.0 Well, you can do this with PROMPT_COMMAND='sleep 1'. I don't see the need for another internal variable to do this. pgpTYMNSu6HsQ.pgp Description: PGP signature

Re: Following symlinks in globstar

2014-01-21 Thread Chris Down
On Thu, 1 Aug 2013 13:02:31 +0200, Chris Down wrote: > As we're probably all aware, `globstar' follows symlinks when doing > recursive traversal. Is it possible to, at some future version, have > an option that enables/disables (I guess enables by default for > backwards co

Re: Including \t, \T or \A at beginning of PS1 causes line wrap issues

2014-01-16 Thread Chris Down
+Cc: bug-bash Please do not take discussions off-list, it decreases the value of conversations for future readers. On 2014-01-16 23:13:35 -0600, David C. Rankin wrote: > A sanitized version w/o color. That detail matters -- please include the full scope of the issue in future when reporting issu

Re: Including \t, \T or \A at beginning of PS1 causes line wrap issues

2014-01-14 Thread Chris Down
Hello, On 2014-01-15 00:17:22 -0600, David C. Rankin wrote: > I apologize if you get two of these reports, but my server responded that > the > mail did not go through when I exited vi. Here is the contents generated by > bashbug about the line wrap issue when including \t, \T or \A at beginnin

Re: Including \t, \T or \A at beginning of PS1 causes line wrap issues

2014-01-14 Thread Chris Down
Hello, On 2014-01-15 00:17:22 -0600, David C. Rankin wrote: > I apologize if you get two of these reports, but my server responded that > the > mail did not go through when I exited vi. Here is the contents generated by > bashbug about the line wrap issue when including \t, \T or \A at beginnin

Re: Why bash doesn't have bug reporting site?

2014-01-13 Thread Chris Down
On 2014-01-13 22:31:01 -0800, Yuri wrote: > e-mail has quite a few vulnerabilities. Spam, impersonation, etc. In the > system relying on e-mail, spam filter has to be present. And due to this you > will get false positives and false negatives, resulting in lost information. > On the opposite, login

Re: tab expansion of $HOME/ to \$HOME/

2014-01-13 Thread Chris Down
On 2014-01-13 20:42:39 -0500, Chet Ramey wrote: > You can set the `direxpand' option and probably get around most of this, > with the change that variables will be expanded upon completion, as in > bash-4.1. Er, somehow I missed this reply. Sorry for duplicating the content. pgpVryxnvHcrm.pgp De

Re: tab expansion of $HOME/ to \$HOME/

2014-01-13 Thread Chris Down
On 2014-01-13 11:00:09 +0100, Diggory Hardy wrote: > If I enter > > $ ls $HOME/Do > > and press the Tab key, bash expands to > > $ ls \$HOME/Documents See this older thread[0]. If you bash >= 4.2.29 (which it appears you do), you can turn on `direxpand' to get the old behaviour back by using `

Re: Why bash doesn't have bug reporting site?

2014-01-13 Thread Chris Down
On 2014-01-13 12:26:43 -0800, Yuri wrote: > I noticed that bash is in absolute minority of projects not using any bug > reporting system. Instead, users are directed to this ML to report bugs. > It seems like it could have been very beneficial so that people could track > the status of the issues.

Re: For loop prints two $values instead of one

2014-01-06 Thread Chris Down
Hello, On 2014-01-07 00:45:42 +0200, DanielB wrote: > I've a problem with bash array loop. > > the following code instead of printing each value separately, joins two > values and prints them as if they are one. > > declare -a array=( 'sf052' 'to060' 'pw' 'qb099' 'pw22' 'wp039' 'wx12' > 'wx11' )

Setting "cdspell" does not return error in a non-interactive shell

2013-12-28 Thread Chris Down
From "man 1 bash" on 4.2.45: cdspell If set, minor errors in the spelling of a directory com‐ ponent in a cd command will be corrected. The errors checked for are transposed characters, a missing charac‐ ter, and one character too many. If a

Re: problem with pathname expansion

2013-12-26 Thread Chris Down
On 2013-12-27 07:16:12 +0400, vollitwr . wrote: > Thank you very much. You had explainded the problem. However it does > not remove it. :-( It is not bug according to documentation. But it > is the pure formality only. It looks like deep and conceptual error > beyond scope of the bash developer

Re: I think bash logic in a loop like : while [ condition] |read somevar is flawed.

2013-12-24 Thread Chris Down
On 2013-12-24 10:16:28 +0100, rens wrote: > you are a master at evading the issue. > > and therefore, i.m.h.o, completely useless as a programmer. You appear to have become confused into thinking that I have an interest in helping people that do not want to listen or learn. I apologise if I misl

Re: I think bash logic in a loop like : while [ condition] |read somevar is flawed.

2013-12-24 Thread Chris Down
On 2013-12-24 09:25:05 +0100, rens wrote: > *read is a built in. there is no subshell. $ echo "$BASHPID"; : | echo "$BASHPID" 26269 26271 > any way, it seems then to me that even IF "read" was a subshell, the scope > of that would start and end with the read statement. I don't know

Re: soft-bug (should be in planning queue)...

2013-12-23 Thread Chris Down
On 2013-12-21 14:13:25 -0800, Linda Walsh wrote: > Did you mean july 2013? Probably not, plenty of 4.3 code is not being backported. pgprkzu2zkgSh.pgp Description: PGP signature

Re: I think bash logic in a loop like : while [ condition] |read somevar is flawed.

2013-12-23 Thread Chris Down
On 2013-12-23 23:57:32 +0100, rens wrote: > Hello, > > this script: > ___ > export cval=0 > echo entering while > > # listing ten files, to generate some output to count. > ls -1 /usr/bin|head -10 |while read fname Just use a `for` loop and a glob. Really. It's that easy. >

Re: Replacing addresses

2013-11-28 Thread Chris Down
On 2013-11-28 13:01:49 -0500, Chet Ramey wrote: > I think this is a global setting Ouch. > and probably does more good than the annoyance it causes. I don't think so. From my anecdotal experience, I've only ever had it cause irritation when reading the archives. There are a million better ways t

Replacing addresses

2013-11-28 Thread Chris Down
On 2013-11-28 08:23:01 -0400, Peter Cordes wrote: > Oh, also, the online bug-bash archive has a bad habbit of replacing > code with address@hidden. There was a whole thread about setting > PS1=whatever that is now a complete mystery to non-subscribers! Yes, let's please stop this useless obfusca

Re: Testcase for cd -@ / O_XATTR

2013-11-06 Thread Chris Down
On 2013-11-06 22:23:41 -0500, Chet Ramey wrote: > I'll think about it. I generally don't like to add test cases for features > that are available on so few platforms. Why? Surely that is the place where such test cases would be most valuable? pgpkMsDg4AKUh.pgp Description: PGP signature

Re: Bash-4.3-beta2 available for FTP

2013-11-05 Thread Chris Down
On 2013-11-05 23:12:00 +0100, Lionel Cons wrote: > Build instructions: > git clone --branch devel git://git.savannah.gnu.org/bash.git If you're only planning on sending in e-mail patches, then you might as well use --depth 1. pgpCGcGWdbeAL.pgp Description: PGP signature

Re: can't just hold down ^K to clean up history

2013-10-16 Thread Chris Down
On 2013-10-16 20:53, jida...@jidanni.org wrote: > Let's say one accidentally pastes a many lines of some email into a bash > window. Firstly: you should be careful not to do that. > Yes bash tries to execute each line. Can't blame it. Well, it's the expected behaviour. Bash doesn't know the diff

Re: Bash 4.2 completion fails with failglob option enabled

2013-10-04 Thread Chris Down
On 2013-10-04 09:35, Chet Ramey wrote: > On 10/4/13 3:32 AM, Chris Down wrote: > > On 2013-10-02 16:33, Andrey Osipov wrote: > >> Is failglob meant to be used in interactive shell? > > > > Basically, you can't use it right now if you are using completions tha

Re: -e and permission denied

2013-10-04 Thread Chris Down
On 2013-10-04 02:18, vic...@vsespb.ru wrote: > > The operating system is (on purpose) not letting you know if that file > > exists or not > > OS is not lying about file existence. It returns "permission denied" error, > which means file may or may not exist. Nobody said the OS is lying, it's merel

Re: Bash 4.2 completion fails with failglob option enabled

2013-10-04 Thread Chris Down
On 2013-10-02 16:33, Andrey Osipov wrote: > Is failglob meant to be used in interactive shell? Basically, you can't use it right now if you are using completions that could return empty globs. pgpS0076Al6m7.pgp Description: PGP signature

Re: bash built-ins `true' and `false' undocumented

2013-09-27 Thread Chris Down
On 2013-09-27 20:19, Roland Winkler wrote: > Yet I think that the info pages are supposed to provide the definitive > information about GNU software. So I still believe that it would be > useful to list these builtins in the info pages, too. Certainly, > the info pages are more useful for getting

Re: multi-line like C-style comments ( /* code */ ) in bash

2013-09-07 Thread Chris Down
On 2013-09-07 20:05, Edik Bondarenko wrote: > I am added function `discard_multiline_comments` which disables code > between /* and */ (C-style comments). > The body of the function is located in the file y.tab.c : 5140 . > Can this functionality be added in the next release ? Please look into how

Re: Failglob issues

2013-09-01 Thread Chris Down
On 2013-09-01 12:45, Nikolai Kondrashov wrote: > 1) With both nullglob and failglob enabled it is considered an error for a >glob not to match anything. I'd say it's more natural to not produce an >error in this case. Otherwise a fairly useful behavior is broken, like >glob use in "for"

Re: i++ cause bad return code when result is 1

2013-08-26 Thread Chris Down
On 2013-08-26 22:06, Chris F.A. Johnson wrote: > Rather, that it is != 0 Er, yes. That's what I get for writing messages at 4am! pgp7Icwgcq_MV.pgp Description: PGP signature

Re: failed grep should cause subshell to exit

2013-08-26 Thread Chris Down
On 2013-08-27 03:48, Chris Down wrote: > It does -- like Andreas said, it just makes it immune to `set -e'. > > $ set -e > $ > file > $ ! grep foo file > $ echo $? > 0 Or, perhaps more closely matching your case: $ set -e $ echo foo

Re: failed grep should cause subshell to exit

2013-08-26 Thread Chris Down
On 2013-08-26 21:41, David Lehmann wrote: > I expected the '!' to reverse the exit code, such that if the grep return 0 > (success), the expression would return 1 (failure); if the grep returned > non-zero (failure), the expression would return 0 (success). i.e. I > expected the '!' to behave lik

Re: i++ cause bad return code when result is 1

2013-08-26 Thread Chris Down
On 2013-08-26 21:36, David Lehmann wrote: > My issue is that the resulting behavior in Exercise 1 does not make sense. > > The resulting value of i should have no bearing on the exit code. If the > addition succeeded, the expression should return 0 (success). If i was not > an integer (e.g. i=he

Re: Subscribe

2013-08-24 Thread Chris Down
On 2013-08-24 07:21, Michael Harris wrote: > Sincerely, > > > > Michael B. Harris > > Kc9cmt,Recording Secretary, MRAC > > Linux User #1063 > > 42.922241,-87.880583 > > (Unimatrix Zero) > > > > Linux Penguins > > > http://s0.cyberciti.or

Re: feature request: file_not_found_handle()

2013-08-21 Thread Chris Down
On 2013-08-21 13:12, Ken Irving wrote: > Yes I do have some idea. I read the bash-bug list regularly, and many > times (even if you can't tell) refer to the wiki you host, read the FAQs, > RTFMs, try to absorb what wisdom I can, and in general try to improve on > the bash coding I do use. But thi

Re: feature request: file_not_found_handle()

2013-08-21 Thread Chris Down
On 2013-08-20 18:47, Linda Walsh wrote: > If it wasn't for things doing what we don't expect, many things wouldn't be > around (aspirin, popcorn, digitalis, Rogain, & tons more... most things are > found by NOT using them they way you are directed to use them). This is such a poor analogy that I d

Re: child_pid of background process? (not in manpage?)

2013-08-19 Thread Chris Down
On 2013-08-19 07:42, Greg Wooledge wrote: > A long time ago I submitted a patch that would change all of these to > include their $ so that people could SEARCH for them and FIND them, > but the patch was not accepted. I support this patch. pgptg7YdQPdN5.pgp Description: PGP signature

Re: child_pid of background process? (not in manpage?)

2013-08-18 Thread Chris Down
On 2013-08-18 17:46, Linda Walsh wrote: > I don't find the variable for the process ID of the > last started background process documented in the bash manpage... > > Am I just missing it, or did it get left out by accident or > where did it go? First of all, it would help if you gave your version.

Re: i++ cause bad return code when result is 1

2013-08-18 Thread Chris Down
On 2013-08-18 16:57, David Lehmann wrote: > The ((i++)) fails only when the result is 1. When the result is 0 or 2, it > does not fail. This is a problem when 'set -e'. This is normal and expected. If the value returned in an (( expression is zero, then the exit code is 1. Since you're using a p

Re: bash error

2013-08-16 Thread Chris Down
On 2013-08-16 06:07, Anand, Kuldip wrote: > I have installed cygwin in windows 2008 R2(cgysnap29503) server and when I am > trying to ssh using s_tibco account I am getting error :-- > > 104 ls1238p.encana.com:/home/kanand99 % ssh > s_tibco@cgysnap29503 > s_tibco@cgys

Re: possible bash bug - 'history'

2013-08-10 Thread Chris Down
On 2013-08-09 16:10, Chet Ramey wrote: > So is there enough of a need to make 0 do something different? Or does > $BASH_COMMAND suffice? (I suspect the answer to that question is "no", > because it deals with commands rather than input lines.) I agree, for this case I don't think $BASH_COMMAND su

Re: Bash gives error string splice

2013-08-08 Thread Chris Down
On 8 Aug 2013 23:18, "Williams, Zak" wrote: > Repeat-By: >Replicating the code I have below. You will then want to call this script via the bottom of the .bashrc file ( sh [path to script here] ). This is not a bash bug, nor is it a bug at all, because sh is not bash. On your syst

Re: Arithmetic assignment side-effects

2013-08-04 Thread Chris Down
On 2013-08-04 22:41, Andreas Schwab wrote: > x+=a is the same as x=x+a. In most cases I'd agree, in this case I think it changes the logic when considering += as an atomic increment (which, of course, += isn't, but aesthetically it presents itself as such) as opposed to two separate operations. >

Re: Arithmetic assignment side-effects

2013-08-04 Thread Chris Down
On 2013-08-03 17:04, Dan Douglas wrote: > Is it specified what the value of x should be after this expression? > > x=0; : $((x+=x=1)) I don't know if it is specified in a standard (I suspect it may be undefined), but it looks pretty clear to me that the answer should be 2. Has anyone proposed logi

Re: Misleading phrasing about $! in documentation

2013-08-01 Thread Chris Down
On 2013-08-01 11:37, Chet Ramey wrote: > How about the command (or job) most recently placed in the background. That works for me. I'd be more inclined to use "job" since it avoids confusion about what happens when backgrounding a pipeline. Thanks. pgp2RdgUre66e.pgp Description: PGP signature

Following symlinks in globstar

2013-08-01 Thread Chris Down
As we're probably all aware, `globstar' follows symlinks when doing recursive traversal. Is it possible to, at some future version, have an option that enables/disables (I guess enables by default for backwards compatibility) following symlinks? This can be quite irritating when trying to traverse

Misleading phrasing about $! in documentation

2013-07-31 Thread Chris Down
I think our documentation on $! is a little misleading. `man bash' states: Special Parameters The shell treats several parameters specially. These parameters may only be referenced; assignment to them is not allowed. [...] ! Expands to the process ID of the mo

Re: Bug in function return statement in while subshell

2013-07-30 Thread Chris Down
On 2013-07-30 10:18, Greg Wooledge wrote: > After the fork() which creates the subshell, each of the two processes > (parent and child) is still within its own instance of the function. > The "return" command executed in the child causes the child's function > to terminate, but this does not cause

Re: Bug in function return statement in while subshell

2013-07-30 Thread Chris Down
On 2013-07-30 13:15, Pierre Gaston wrote: > There are 2 loop levels in my example, but break only exit the subshell. Yes, that's what I was saying. I think this should only exit the subshell (although I'd like to see break and its family returning errors when you are trying to operate on more loop

Re: Bug in function return statement in while subshell

2013-07-30 Thread Chris Down
On 2013-07-30 12:45, Pierre Gaston wrote: > On Tue, Jul 30, 2013 at 12:29 PM, Chris Down wrote: > > On 2013-07-30 12:11, Pierre Gaston wrote: > >> what about things like this: foo () ( return 1; ) > > > > Except in this case, the return has a valid context. I

Re: Bug in function return statement in while subshell

2013-07-30 Thread Chris Down
On 2013-07-29 17:05, Chris Down wrote: > On 29 Jul 2013 17:00, "Roman Rakus" wrote: > > > > I didn't take a look on where the problem could be, but it is discussed > on stackoverflow [1]. > > > > Looks like return builtin falsely exit execution of whi

Re: Bug in function return statement in while subshell

2013-07-30 Thread Chris Down
On 2013-07-30 12:11, Pierre Gaston wrote: > what about things like this: foo () ( return 1; ) Except in this case, the return has a valid context. I don't see how it's really comparable to the represented case. pgpeaKMNUypTl.pgp Description: PGP signature

Re: Bug in function return statement in while subshell

2013-07-29 Thread Chris Down
On 29 Jul 2013 17:00, "Roman Rakus" wrote: > > I didn't take a look on where the problem could be, but it is discussed on stackoverflow [1]. > > Looks like return builtin falsely exit execution of while loop instead of function. Unless I'm reading this wrongly, this seems like expected behaviour

Re: Error in read implementation and/or documentation

2013-07-27 Thread Chris Down
On 27 July 2013 17:17, Pierre Gaston wrote: > What is your test case? > I don't seem to be able to reproduce your problems, read returns > when it encouters EOF, and I get 1 if fewer bytes are read It seems it is something like this: $ read -n3 12^D$ echo $? 0

Re: Error in read implementation and/or documentation

2013-07-27 Thread Chris Down
On 27 July 2013 19:32, Andreas Schwab wrote: > Chris Down writes: >> Cannot reproduce. >> >> $ printf 01 | read -n3 >> $ echo $? >> 1 > > Try the same with input from the terminal. Hm, that's a whole other problem then. I can reproduce this by following that path.

Re: Error in read implementation and/or documentation

2013-07-27 Thread Chris Down
Hello, On 27 July 2013 06:37, Peter Olson wrote: > If read is invoked with the -n or -N options, then given an EOF, it returns > with a zero exit status. Cannot reproduce. $ echo $BASH_VERSION 4.2.45(2)-release $ read -n1 In addition, if it is invoked with -n 3, for example, then g

Re: Chained command prints password in Clear Text and breaks BASH Session until logout

2013-07-11 Thread Chris Down
On 12 Jul 2013 01:29, "Chris Down" wrote: > What does this have to do with bash? This is almost certainly an issue with your terminal it MySQL client. What about this would constitute a bash bug? s/\bit\b/or/

Re: Chained command prints password in Clear Text and breaks BASH Session until logout

2013-07-11 Thread Chris Down
On 12 Jul 2013 01:25, "Jason Sipula" 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-redhat-linux-gn

Re: PS1 multiline with colors

2013-07-04 Thread Chris Down
> Repeat-By: > With mintty terminal: > PS1='\h Hello everybody\n\e[1;35m\]Hi\e[0m\]>' > << cursor up >> > << cursor down >> > the line look like: > Hi>PS1='\h Hello > > With putty terminal (with default configuration): > with the same

Re: Bug report command "cd"

2013-07-03 Thread Chris Down
On 4 July 2013 00:08, Chris Down wrote: > Greetings. > > On 3 July 2013 17:52, Stephan van Ingen wrote: >> stephanbosal@in-laptop3:~/Downloads/Win8$ *cd --SMSBOOT-sources-/* >> bash: cd: --: invalid option >> cd: usage: cd [-L|[-P [-e]]] [dir] >> stephanbosal

Re: Bug report command "cd"

2013-07-03 Thread Chris Down
Greetings. On 3 July 2013 17:52, Stephan van Ingen wrote: > stephanbosal@in-laptop3:~/Downloads/Win8$ *cd --SMSBOOT-sources-/* > bash: cd: --: invalid option > cd: usage: cd [-L|[-P [-e]]] [dir] > stephanbosal@in-laptop3:~/Downloads/Win8$ *cd \-\-SMSBOOT-sources-/* > bash: cd: --: invalid option

Re: regex confusion -- not matching; think it should?

2013-06-19 Thread Chris Down
On 20 June 2013 00:43, Greg Wooledge wrote: > On Thu, Jun 20, 2013 at 12:39:56AM +0800, Chris Down wrote: >> On 20 June 2013 00:29, DJ Mills wrote: >> > wordsplitting and pathname expansion do not occur within the >> > [[ keyword. >> >> $ > foo >>

Re: regex confusion -- not matching; think it should?

2013-06-19 Thread Chris Down
On 20 June 2013 00:29, DJ Mills wrote: > wordsplitting and pathname expansion do not occur within the > [[ keyword. $ > foo $ [[ foo == * ]] && echo bar bar

Re: `printf -v foo ""` does not set foo=

2013-06-16 Thread Chris Down
On 17 June 2013 13:27, Mike Frysinger wrote: > simple test code: > unset foo > printf -v foo "" > echo ${foo+set} > > that does not display "set". seems to have been this way since the feature > was added in bash-3.1. Interesting. It also won't change it if it already exi

Re: currently doable? Indirect notation used w/a hash

2013-06-14 Thread Chris Down
On 14 Jun 2013 10:21, "Linda Walsh" wrote: >> Please, no more brittle export hacks. I'm already crying enough at function exports. > > > Brittle would be bad. Pliant and chewy would be much better, I agree. > > Perhaps you might explain what you mean by brittle? Like the export hacks > you get i

Re: currently doable? Indirect notation used w/a hash

2013-06-14 Thread Chris Down
On 14 Jun 2013 00:57, "Linda Walsh" wrote: > > > > Chet Ramey wrote: >>> >>> Now I want to access the value for IP for the current "IF" (IF holding >>> eth0 or eth1 or some other InterFace name). >> >> >> This is an excellent statement of the rationale for nameref variables, >> which will be imple

Re: bug batch

2013-06-13 Thread Chris Down
On 13 Jun 2013 11:00, "Linda Walsh" wrote: > If you do it without the ':', it returns a false status. > The colon doesn't seems to return true or false based on whether or not > there was a syntactic error, but not for a command that runs normally and returns > any status. : is just a noo

Re: currently doable? Indirect notation used w/a hash

2013-06-11 Thread Chris Down
On 11 Jun 2013 02:19, "Mike Frysinger" wrote: > > On Monday 10 June 2013 18:20:44 Chris F.A. Johnson wrote: > > On Mon, 10 Jun 2013, Linda Walsh wrote: > > >> Point taken, but the only way such a string would be passed as a > > >> variable name is if it was given as user input -- which would,

Re: currently doable? Indirect notation used w/a hash

2013-06-10 Thread Chris Down
Enjoy your arbitrary command execution. On 10 Jun 2013 14:15, "Chris F.A. Johnson" wrote: > On Mon, 10 Jun 2013, Greg Wooledge wrote: > > On Sun, Jun 09, 2013 at 02:02:02PM -0700, Linda Walsh wrote: >> >>> I was wondering if I was missing some syntax somewhere... >>> but I wanted to be able to p

  1   2   >