Re: whats wrong , exit code 11 on android termux

2024-08-10 Thread Chris Elvidge
l don't believe you, tell them to contact me directly. -Martin Kealey *1: if you suspect that the person is over 70, you'd best avoid their given name entirely, and stick to honorific+surname. Mr/Mrs Firstname is common in the subcontinent - and elsewhere in the middle east. Your prejudices should not warrant a rant. -- Chris Elvidge England

[PATCH] loadables/sync: allow fsync of individual files like GNU coreutils

2022-12-18 Thread Chris Webb
ith a read-only file descriptor, but on AIX and Cygwin write access is required, so we attempt that first. Signed-off-by: Chris Webb --- examples/loadables/sync.c | 52 +-- 1 file changed, 45 insertions(+), 7 deletions(-) diff --git a/examples/loadables/syn

Re: Handling files with CRLF line ending

2022-12-08 Thread Chris Elvidge
On 08/12/2022 19:34, Ángel wrote: On 2022-12-07 at 12:38 +, Chris Elvidge wrote: I don't use Python generally, but my understanding of it (only a quick test) f = open("demofile2.txt", "a") f.write("Now the file has more content!") f.close() f.write does

Re: Handling files with CRLF line ending

2022-12-07 Thread Chris Elvidge
On 06/12/2022 23:39, L A Walsh wrote: On 2022/12/06 10:57, Chris Elvidge wrote: Yair, how about using the Python installed in the WSL instance. --- Oh, I wondered why Python used CRLF, but nothing else did. What version of python are you using? The Python for WSL, the python for

Re: Handling files with CRLF line ending

2022-12-06 Thread Chris Elvidge
there. Windows text files have to be converted to Linux format before processing - either inline (tr -d '\r') or in mass (dos2unix). Expecting bash to cope is a non-starter. Yair, how about using the Python installed in the WSL instance. -- Chris Elvidge England

Hierarchical data (was: Light weight support for JSON)

2022-09-01 Thread Chris Dunlop
d be using it all the time there as well. Chris

Re: forwarded weirdness report

2022-03-29 Thread Chris Elvidge
On 28/03/2022 22:00, Greg Wooledge wrote: Or -- and I know this answer will be rejected, because it's too simple and sensible -- stop using aliases in scripts. +1 Or could just stop answering questions about aliases in scripts -- Chris Elvidge England

Re: Squiggly heredoc - new feature request

2021-08-30 Thread Chris Elvidge
blabla EOF ) This would break backward compatibility and POSIX compliance. I'm sure there are real life scripts that have leading spaces in their here-doc payloads which should be preserved. Yes there are. -- Chris Elvidge England

Re: RFE: new option affecting * expansion

2021-08-11 Thread Chris F.A. Johnson
On Wed, 11 Aug 2021, Chet Ramey wrote: On 8/10/21 5:08 PM, Chris F.A. Johnson wrote: It would be nice if there were an option to allow * to expand sorted by timestamp rather than aphabetically. When you say `timestamp' I assume you mean by last modification time. Yes, that's wh

RFE: new option affecting * expansion

2021-08-10 Thread Chris F.A. Johnson
It would be nice if there were an option to allow * to expand sorted by timestamp rather than aphabetically. -- Chris F.A. Johnson <http://cfajohnson.com/> === Author: === Shell Scripting Recipes: A P

noclobber and redirected group command

2021-08-09 Thread chris
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -g -O2 -fdebug-prefix-map=/build/bash-a6qmCk/bash-5.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wno-parentheses -Wno-format-security uname o

Re: Extended regex match (shmatch.c:115) malloc error

2021-08-09 Thread Chris F.A. Johnson
free: start and end chunk sizes differ Aborting...ABORT instruction (core dumped) ------ I get: '123' in '123 text!' (bash 5.1 in mate-terminal) -- Chris F.A. Johnson

Re: `&>' doesn't behave as expected in POSIX mode

2021-06-20 Thread Chris Elvidge
edirects both stderr and stdout to `/dev/null'. Oğuz If you want to parse them as two separate commands, separate them. -- Chris Elvidge England

Re: Default PS1

2021-03-29 Thread Chris Elvidge
On 29/03/2021 12:04 pm, ილია ჩაჩანიძე wrote: How can I set default PS1 variable from source code? E.g I want it to display: My-linux-distro $ And not: Bash-5.1 $ Set it in $HOME/.bashrc -- Chris Elvidge England

Re: Redirection between assignment statement and command name prevents alias substitution

2021-03-25 Thread Chris F.A. Johnson
I couldn't use a function (which I do for all interactive uses) because that would change $FUNCNAME. -- Chris F.A. Johnson <http://cfajohnson.com/> === Author: === Shell Scripting Recipes: A Problem-Soluti

Re: is it a bug that PWD=whatever sets PS1's \w to that regardless

2021-03-16 Thread Chris Elvidge
$PWD If you want to register the current directory in $PS1 regardless, change \w to `pwd` -- Chris Elvidge England

Re: syntax error while parsing a case command within `$(...)'

2021-02-16 Thread Chris Elvidge
'x' ε in ε '(' 'x' ')' ε if_clause Esac -> ... where ε is an empty string. OK, now I understood this behavior is actually required by the POSIX standard. Can we find any textual explanation on this rule? Or maybe this behavior is intuitive enough for those who understand the shell grammar so that they don't see the necessity of an additional explanation... Thank you for the comment! -- Koichi -- Chris Elvidge England

Re: Feature: where terminal reports mouse click to bash, support positioning the cursor accordingly

2021-01-17 Thread Chris F.A. Johnson
use button to position the cursor. https://cfajohnson.com/shell/?2005-07-15_mousetraps -- Chris F.A. Johnson <http://cfajohnson.com/> === Author: === Shell Scripting Recipes: A Problem-Solution Approa

Re: bash doesn't display user-typed characters; can interfere with COPY/PASTE

2020-12-08 Thread Chris Elvidge
eir terminal. Where this can be even more annoying is if your terminal's response to a tab is different than that used on old-hardware terminals. Thanks, -l Try Ctrl-V before hitting . -- Chris Elvidge England

Re: [ping] declare -c still undocumented.

2020-11-13 Thread Chris Elvidge
t ${var^} still doesn't know that it should apply to the first alpha character in a string. Similar for , and ~. If the first character of the string is a punctuation character, e.g.(, it doesn't work (as I would like it to ). -- Chris Elvidge England

Re: Bad substitution breaks conditional statement

2020-10-12 Thread Chris Elvidge
up to you to check if version X-1 is being used and throw an error there. Isn't that what $BASH_VERSION / $BASH_VERSINFO is for? -- Chris Elvidge England

Re: Incrementing variable=0 with arithmetic expansion causes Return code = 1

2020-08-28 Thread Chris Elvidge
gendorf Telefon +41 61 417 10 68 Web www.bpm.ch<http://www.bpm.ch/> From man bash: ((expression)) The expression is evaluated according to the rules described below under ARITHMETIC EVALUATION. If the value of the expression is non-zero, the return status is 0; otherwise the return statu

Re: Expand first before asking the question "Display all xxx possibilities?"

2020-08-05 Thread Chris Elvidge
oose for the first expansion? Thanks for the suggestion. -- Chris Elvidge England

File descriptor leak

2020-07-30 Thread Chris Dunlop
.org/archive/html/bug-bash/2017-01/msg00026.html - https://github.com/lvmteam/lvm2/blob/e10f20bc23088a2f9f7529f8f2b40d9c1fcb54c6/tools/lvmcmdline.c#L -- Chris Dunlop

Re: Return from function depending on number of parameters

2020-07-10 Thread Chris Elvidge
it. Are the two uses (array subscript and arithmetic context) of [...] connected/related? Or am I (stupidly) seeing a connection where none really exists? Thanks -- Chris Elvidge England

Re: Return from function depending on number of parameters

2020-07-09 Thread Chris Elvidge
On 06/07/2020 12:50 pm, Greg Wooledge wrote: On Fri, Jul 03, 2020 at 07:00:54PM +0100, Chris Elvidge wrote: I've used 'return $((!$#))' and 'return $[!$#]' to return an error if no parameters given to function. The problem with this is that it *always* returns fro

Re: Return from function depending on number of parameters

2020-07-04 Thread Chris Elvidge
On 03/07/2020 11:16 pm, Eli Schwartz wrote: On 7/3/20 2:00 PM, Chris Elvidge wrote: I've used 'return $((!$#))' and 'return $[!$#]' to return an error if no parameters given to function. Tested in a bash script 'exit $((!$#)) / $[!$#]' - both work. 'ech

Re: Return from function depending on number of parameters

2020-07-04 Thread Chris Elvidge
On 03/07/2020 10:39 pm, Lawrence Velázquez wrote: On Jul 3, 2020, at 2:00 PM, Chris Elvidge wrote: However 'N=0; echo $((!$N))' gives an error at the bash prompt. 'echo $[!$N]' echo's 1 as expected. My question - is $[...] actually obsolete? It might tell you som

Re: Return from function depending on number of parameters

2020-07-04 Thread Chris Elvidge
On 03/07/2020 11:16 pm, Eli Schwartz wrote: On 7/3/20 2:00 PM, Chris Elvidge wrote: I've used 'return $((!$#))' and 'return $[!$#]' to return an error if no parameters given to function. Tested in a bash script 'exit $((!$#)) / $[!$#]' - both work. 'ech

Re: Return from function depending on number of parameters

2020-07-04 Thread Chris Elvidge
On 03/07/2020 10:39 pm, Lawrence Velázquez wrote: On Jul 3, 2020, at 2:00 PM, Chris Elvidge wrote: However 'N=0; echo $((!$N))' gives an error at the bash prompt. 'echo $[!$N]' echo's 1 as expected. My question - is $[...] actually obsolete? It might tell you som

Return from function depending on number of parameters

2020-07-03 Thread Chris Elvidge
...] actually obsolete? If so, what should I use at the bash prompt to get the same effect? Cheers -- Chris Elvidge

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
ll from CHANGES or NEWS: they mention some of the compile-time options around SIGTERM and rl_signal_event_hook, but I can't really tell the intent when it comes to this behaviour in particular. Certainly it came as a surprise to me, at least. Thanks, Chris 0: https://unix.stackexchange.com/q/571123/10762

Re: Preventing Bash Variable Confusion

2020-01-30 Thread Chris F.A. Johnson
style definition macros. Variables become extremely identifiable and comprehensible. A text editor, such as emacs in Bash mode, can highlight variables. No need to use any sort of naming convention. -- Chris F.A. Johnson <http://cfajohnson.

Re: Preventing Bash Variable Confusion

2020-01-30 Thread Chris F.A. Johnson
y.) This is just wrong. `local' accepts the same option set as `declare'. There are other things wrong in that book as well; the description of printf, for example. Don't use it as an authority on bash. -- Chris F.A. Johnson

Re: Preventing Bash Variable Confusion

2020-01-29 Thread Chris F.A. Johnson
On Wed, 29 Jan 2020, Greg Wooledge wrote: As long as you use at least one lowercase letter in your variable name, you are guaranteed not to conflict with any internal shell variables. Except for auto_resume and histchars. -- Chris F.A. Johnson <h

Re: man bash does not list 'in' as a builtin command

2019-11-25 Thread Chris F.A. Johnson
e Description: 'in' is a builtin command and is not listed in the man page as such. $ type in in is a shell keyword -- Chris F.A. Johnson <http://cfajohnson.com/> === Author: === Shell

Locale not Obeyed by Parameter Expansion with Pattern Substitution

2019-11-17 Thread Chris Carlen
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -g -O2 -Wno-parentheses -Wno-format-security uname output: Linux safire 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Re: v4.4 segfault in 'decode_prompt_string' when processing special parameter

2018-07-21 Thread Chris Schoenberg
Thanks for taking the time to explain that :) I'll do more homework next time On Sat, Jul 21, 2018, 8:51 PM Chet Ramey wrote: > On 7/21/18 9:16 PM, Chris Schoenberg wrote: > > Fair enough. Even though the behavior is different, the end is the same > as > > udf so mak

Re: v4.4 segfault in 'decode_prompt_string' when processing special parameter

2018-07-21 Thread Chris Schoenberg
Fair enough. Even though the behavior is different, the end is the same as udf so makes sense of you want to leave it. Weird how it popped up in 4.4 though. On Sat, Jul 21, 2018, 6:58 PM Chet Ramey wrote: > On 7/21/18 2:47 PM, Chris Schoenberg wrote: > > This only works in 4.4; earlier

Re: v4.4 segfault in 'decode_prompt_string' when processing special parameter

2018-07-21 Thread Chris Schoenberg
The payload got filtered, so here it is again (substitute the actual character for [at]): $\{_[at]P};${_[at]P} On Sat, Jul 21, 2018, 1:47 PM Chris Schoenberg wrote: > This only works in 4.4; earlier versions throw a 'bad substitution' error. It > causes an infinite loop

v4.4 segfault in 'decode_prompt_string' when processing special parameter

2018-07-21 Thread Chris Schoenberg
This only works in 4.4; earlier versions throw a 'bad substitution' error. It causes an infinite loop of calls between 'expand_prompt_string' and 'decode_prompt_string', where calls to 'xmalloc' exhaust the heap: $\{_@P};${_@P} I decided to report this because it is not a user-defined recursive f

Re: history shows edited lines not the lines actually ran

2018-06-17 Thread chris
On Sat, 16 Jun 2018, L A Walsh wrote: As for usefulness... haven't you ever had to type in a password on the command line? Or, at least had it be easier to do so, but I really don't like leaving it in a file, so I usually scroll up to the line w/the password and just delete the line. Pr

Re: $"\t': Bash bug or not?

2017-11-17 Thread Chris F.A. Johnson
s also commonly installed. -- Chris F.A. Johnson, <http://cfajohnson.com>

Re: consistency probs var & function re-use

2017-06-09 Thread Chris F.A. Johnson
On Fri, 9 Jun 2017, L A Walsh wrote: Chris F.A. Johnson wrote: On Fri, 9 Jun 2017, L A Walsh wrote: First problem: If you are assigning a string to a variable, you need to put quotes around the string. You don't need to quote it unless it contains literal whitespace. Not ex

Re: consistency probs var & function re-use

2017-06-09 Thread Chris F.A. Johnson
On Fri, 9 Jun 2017, L A Walsh wrote: Chris F.A. Johnson wrote: On Fri, 9 Jun 2017, L A Walsh wrote: First problem: If you are assigning a string to a variable, you need to put quotes around the string. You don't need to quote it unless it contains literal whitespace. Not ex

Re: consistency probs var & function re-use

2017-06-09 Thread Chris F.A. Johnson
On Fri, 9 Jun 2017, L A Walsh wrote: First problem: If you are assigning a string to a variable, you need to put quotes around the string. You don't need to quote it unless it contains literal whitespace. -- Chris F.A. Johnson, <http://cfajohnson.com>

Re: weird error due to cntrl-c out of history list

2017-02-20 Thread Chris F.A. Johnson
call -- Chris F.A. Johnson, <http://cfajohnson.com>

Re: 'cat' and 'rm' as builtins ?

2016-10-30 Thread Chris F.A. Johnson
On Sun, 30 Oct 2016, Tim Rühsen wrote: ... Since cat and rm implementations are pretty small in code size, I wonder if you (the maintainers) would accept patches to make these commands builtin commands. Have you looked at the loadable builtins in the examples directory? -- Chris F.A

POSIX Bug

2016-08-26 Thread Chris Lunniss
[1] 25647 BASH (1) GNU Bash - 3.2 Unfortunately the POSIX site was to quick for me to respond prior to it shutting me out. I raised a question which caused it to do so. I would like to continue the offer if it is still available at all? Kind regards Chris.

Re: Bash-4.4-beta2 available for download

2016-07-13 Thread Chris F.A. Johnson
On Wed, 13 Jul 2016, Chet Ramey wrote: On 7/13/16 10:58 AM, Chet Ramey wrote: On 7/13/16 10:49 AM, Chris F.A. Johnson wrote: On Tue, 12 Jul 2016, Chet Ramey wrote: The second beta release of bash-4.4 is now available with the URL ftp://ftp.cwru.edu/pub/bash/bash-4.4-beta2.tar.gz I get

Re: Bash-4.4-beta2 available for download

2016-07-13 Thread Chris F.A. Johnson
.. done. ==> TYPE I ... done. ==> CWD (1) /pub/bash ... done. ==> SIZE bash-4.4-beta2.tar.gz ... 8932859 ==> PASV ... -- Chris F.A. Johnson, <http://cfajohnson.com>

Parallel build error with 4.4-rc1

2016-03-05 Thread Chris Staub
When building Bash 4.4-rc1 with "make -j4", it is possible to get a make error due to the build system attempting to copy a file to a directory before that directory has been created. It will try to copy "Makefile.inc" to $(loadablesdir), but the command to actually create $(loadablesdir) might

Re: bash incorrectly handles 'echo' + SIGPIPE under some situations on Linux

2016-01-06 Thread Chris Siebenmann
> > If Bash writes to stdout with the built in echo and gets a SIGPIPE, > > it can incorrectly buffer and then repeat this would-have-been output > > in at least $(...) things invoked in a cleanup function and in fact > > in some other contexts as well. To see this in action, create the > > followi

Re: Bash logo

2015-12-16 Thread Chris F.A. Johnson
h the proposed new logo designs where you can vote for your favorite: http://goo.gl/forms/qjohwvtgys I chose no. 2, but I would like it better with the colours reversed. -- Chris F.A. Johnson, <http://cfajohnson.com>

"fc" builtin exits with unexpected status

2015-11-16 Thread Chris Marusich
he devel", which I presume means the latest development branch of GNU bash. I hope this is enough information to help figure out what the problem is and fix it. Thank you, Chris Marusich

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

2015-10-17 Thread Chris F.A. Johnson
On Sun, 18 Oct 2015, 積丹尼 Dan Jacobson wrote: "CFAJ" == Chris F A Johnson writes: CFAJ> Or just press UP (as many times as necessary) and RET. That won't get me to a $ prompt. I want to suspend my search and resume it later. ^Z then fg -- Chris F.A. Johnson, <http://cfajohnson.com>

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

2015-10-17 Thread Chris F.A. Johnson
sed ^C to get myself back to a prompt so I could type in the command. Now I want to resume searching and must type my ^Rlong_search_string all over again. OK I suppose I can train myself to do ^A # RET or ESC ESC # instead. Or just press UP (as many times as necessary) and RET. -- Chris F.A. Johns

Re: Design question(s), re: why use of tmp-files or named-pipes(/dev/fd/N) instead of plain pipes?

2015-10-17 Thread Chris F.A. Johnson
?? I've never seen a usage where it expands to a filename and is treated as such. Try this: echo <(cat /etc/passwd) -- Chris F.A. Johnson, <http://cfajohnson.com>

Re: coredump with wait -n

2015-08-22 Thread Chris F.A. Johnson
dump core if you try with multiple jobs. $ bash --norc bash-4.3$ sleep 1 & sleep 2 & wait -n [1] 8368 [2] 8369 [1]- Donesleep 1 bash-4.3$ ^C*** stack smashing detected ***: bash terminated I have no problem running that line, and ^C still works. -- Chris F.A. Johnson, <http://cfajohnson.com>

Re: No support for spaces in for loop

2015-08-18 Thread Chris F.A. Johnson
ctly parse files containing spaces in their filenames. For example file "an image of duck.jpg" will be interpreted as 4 files "an" "image" "of" "duck.jpg" Yes, it does. Your problem is (probably, since you didn't include an example) tha

Re: BUG?: (or what's going on?) test for NL == NL fails (bash-4.3.39(3)-release)

2015-08-02 Thread Chris F.A. Johnson
ot; "'$1" ; } ord () { local nl=""; isatty && nl="\n"; printf "%d$nl" "'$1" ; } ord "$(printf "\n")" Trailing newline are stripped from command substitution, making "$(printf "\n")" and empty string. If you want a newline, use: ord $'\n' -- Chris F.A. Johnson, <http://cfajohnson.com>

Re: Problem with brace expansion

2015-04-21 Thread Chris F.A. Johnson
dash handle either case correctly: Neither pdksh nor dash has brace expansion. -- Chris F.A. Johnson, <http://cfajohnson.com>

Re: Should nested case statements within command substitutions work on in bash 3.2.x?

2015-03-21 Thread Chris F.A. Johnson
bash: -c: line 0: `echo $(case "yes" in yes) echo yes; ;; no) echo no; ;; esac)' It does work with bash 4.x. Is this a known issue with 3.2 or is it particular to the OSX implementation (which in my case is 3.2.53(1))? Balance the parentheses: echo $(case "yes" in

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: Bash-4.3 Official Patch 25

2014-09-24 Thread Chris F.A. Johnson
e ftp://ftp.cwru.edu/pub/bash site just has the main 4.3 file and 25 separate patches to merge. "A downloadable tar file of the current version with all official patches applied is available from savannah." <http://git.savannah.gnu.org/cgit/bash.git/snapshot/bash-master.tar.gz>

^L doesn't clear screen

2014-09-06 Thread chris
VENDOR='unknown' -DLOCALEDIR='/usr/local/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -g -O2 uname output: Linux chris 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:20:46 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux Machine Type: x86_

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: Substring Expansion does not work as intended

2014-08-20 Thread Chris F.A. Johnson
Got: abcdef echo "${x: -2}" Or use a variable: o=-2 echo "${x:$o}" -- Chris F.A. Johnson, <http://cfajohnson.com>

Re: read-only flag is lost for functions in sub shells

2014-07-31 Thread Chris F.A. Johnson
lt; "$READONLY_VARS" readonly "${rov[@]}" fi foo=q ## not permitted -- Chris F.A. Johnson, <http://cfajohnson.com>

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 F.A. Johnson
On Mon, 7 Jul 2014, Notes Jonny wrote: ... Would you consider adding a --help option for "umask" please? (I understand this is a built in command) Maybe also --version I was just hoping to find some help for it. "info umask" and "man umask" also don't say anything. help umask

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
garbage after the > new prompt. Cannot reproduce: chris@lakes:~$ while : > do > : > : > :^C chris@lakes:~$ echo $BASH_VERSION 4.3.0(1)-release Does this happen when you execute bash without sourcing the profile/rc? pgpK34IskcEjm.pgp Description: PGP signature

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: odd behavior from overloading the "source" builtin

2014-03-16 Thread Chris F.A. Johnson
On Sun, 16 Mar 2014, Doug McIlroy wrote: GNU bash, version 4.2.39(1)-release (x86_64-redhat-linux-gnu) interprets this shell script differently when bash input comes from a terminal or when it conmes from a file: source(){ echo x } source In the former case it p

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

  1   2   3   4   5   >