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

^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_

Dresden Bombing Is To Be Regretted Enormously

2005-05-14 Thread chris
Full Article: http://service.spiegel.de/cache/international/0,1518,341239,00.html ___ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash

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: 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: 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: 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: `&>' 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: 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: 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

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

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

[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: cd with multiple arguments?

2010-12-10 Thread Chris Jones
On Fri, Dec 10, 2010 at 05:24:34AM EST, Marc Herbert wrote: > > It's trivial to write a shell function to do that, and many other > > things. > > Things like "good default settings" and "batteries included" Not sure the reference to python (?) is relevant here, since the language by itself does

Re: Strange bug in arithmetic function

2011-02-22 Thread Chris Jones
On Mon, Feb 21, 2011 at 04:13:54AM EST, Marcel de Reuver wrote: > In a bash script I use: $[`date --date='this week' +'%V'`%2] to see if > the week number is even. > Only in week 08 the error is: bash: 08: value too great for base > (error token is "08") the same in week 09, all others are ok...

Re: Is the description of set -- missing in man bash or at least difficult to find?

2011-12-22 Thread Chris Jones
On Thu, Dec 22, 2011 at 01:09:38PM EST, Peng Yu wrote: > Hi, > As I mentioned previously, there are shortcomings in man bash. Here, > I just point another example. And I hope my suggestion will be > addressed. [..] Here's my suggestion, and nothing needs to be ‘addressed’. There are shortcomin

Re: '>;' redirection operator

2011-12-24 Thread Chris Jones
On Sat, Dec 24, 2011 at 10:08:31AM EST, Bill Gradwohl wrote: [..] > The man page is written the way Robbie the Robot used to speak in the old > black and white TV days¹. Short, cryptic and in many cases unintelligible IN > THE DETAILS. Alternatively, one might snicker that some lawyer wrote it to

Re: Bash readline remap ESC insert/command mode key

2012-01-23 Thread Chris Jones
On Mon, Jan 23, 2012 at 08:52:17AM EST, Roger wrote: [..] > Matter of fact, I'm starting to find VIM's long wait time length > a little annoying. ;-) :h tm :h ttm CJ

Re: Bash readline remap ESC insert/command mode key

2012-01-25 Thread Chris Jones
On Mon, Jan 23, 2012 at 07:38:52PM EST, Chet Ramey wrote: > On 1/23/12 8:52 AM, Roger wrote: > > > A little more indepth examination, and I can see VIM's wait is > > approximately double of what the readline patch's wait time is. > > However, I think the shorter wait time is more functional as whe

Re: gnu parallel in the bash manual

2013-02-16 Thread Chris Down
examples should at least be fixed. there are terrible practices > being shown there. > > Count me also in favour of removal of this section. At best the entire section needs a complete rewrite, but why on earth we have a whole section dedicated to a nonstandard external tool is kind of baffling. Chris

Re: Bash stating it is in a directory which does not exist

2013-02-19 Thread Chris Down
This is to do with the way Linux handles open file descriptors. It is not a bug in bash, it is expected (and anticipated) behaviour. Chris On 19 February 2013 14:00, Nikolas Kallis wrote: > Hello, > > > > I have found a bug in Bash: > > /opt/foobar$ > /opt/foobar$

Re: Bash stating it is in a directory which does not exist

2013-02-19 Thread Chris Down
Hi, Please don't break threads by replying to individuals, it destroys the flow of conversation :-) I completely disagree that this would be an improvement to bash. It goes against convention and the principle of least astonishment. It is very un-Unix. Chris On 19 February 2013 22:56, Ni

Re: Bash stating it is in a directory which does not exist

2013-02-19 Thread Chris Down
something > which is not true. > But it is true. It would be lying if it said it didn't exist (it still exists because bash still has an open file descriptor). Chris

cd -e returns syntax error

2013-02-23 Thread Chris Down
-P -e foo' all return the same thing. I'm using the latest version of `bash' as packaged by Arch Linux. I did a search for any previous threads on this issue but didn't find anything, and I didn't see anything on the devel branch (although it's possible I missed it, I guess). Any ideas? Best, Chris

Re: cd -e returns syntax error

2013-02-23 Thread Chris Down
Never mind, I found another thread about the same issue. Best, Chris

Re: "The \". ~/.bash_aliases\" on bashrc don't load file"

2013-02-25 Thread Chris Down
>     D.- Message error "No se ha encontrado la orden «cls» pero hay 18 > similares >     cls: no se encontró la orden" > > Fix: >     Prepend a slash "\" to dot on .bashrc. >     This: >    . ~/.bash_aliases >     To this: >    \. ~/.bash_aliases > > > Something is really wrong with your shell configuration if you have to do this. What is the output of `type .`? Chris

Re: "RE:Re: \"The \\\". ~/.bash_aliases\\\" on bashrc don't load file\""

2013-02-25 Thread Chris Down
On 2013-02-26 01:17, Uroz Gonzalez, Jose Luis wrote: > Hi Chris, > > The output is: > > es un alias de `cd ~' ( . is an alias of "cd ~") > > My apologies. > > Some days ago I tested aliases to best use and tested this, but not deleted. > On restartin

Re: cd -e returns syntax error

2013-02-25 Thread Chris Down
Hey, On 2013-02-24 00:54, Dan Douglas wrote: > On Sunday, February 24, 2013 02:43:03 PM Chris Down wrote: > > Hi all, > > > > Unless I'm misunderstanding how it should work, `cd -P -e' does not work as > > specified by the documentation. From `help cd':

Re: Should this be this way?

2013-02-25 Thread Chris Down
, it should explain the behaviour that you're seeing. It's very well commented, you should be able to find your answer there. Chris

Re: Should this be this way?

2013-02-27 Thread Chris Down
On 2013-02-27 20:05, Linda Walsh wrote: > (maybe distro's shouldn't muck w/user's shells...)... You're using SuSE, which is basically guaranteeing that your programs are mangled in unexpected ways. Then again, it's as bad of an offender as Debian, and most other distributions, I guess... Chris

Re: PATCH: compile Bash 4.2 with DJGPP

2013-03-02 Thread Chris Down
Your patch appears to be mangled with carriage returns. On 2 March 2013 21:52, Fabrizio Gennari wrote: > Hello, > with this patch I successfully compiled Bash 4.2 using a DJGPP > cross-compiler running under Linux (Ubuntu 12.10). May this be applied? > > Regards, > Fabrizio

Re: PATCH: compile Bash 4.2 with DJGPP

2013-03-02 Thread Chris Down
Apparently Gmail has now started mangling attachments. Must be recent. My bad. Chris On 2 March 2013 23:11, Fabrizio Gennari wrote: > Strange, I checked it and even downloaded it again from the list archive at > http://lists.gnu.org/archive/html/bug-bash/2013-03/txtu9EivjW9Sd.txt : there

Re: ignoring current shell and always running posix shell? Re: Should this be this way?

2013-03-13 Thread Chris Down
tures when run in POSIX compliance mode. For the record running rbash without a chroot does not make any sense in reality, it's usually easy to break out of. See my answer here: http://unix.stackexchange.com/a/59394/10762 Chris

Re: If rbash is worthless, why not remove it and decrease bloat?

2013-03-16 Thread Chris Down
nk it increases security (although, whether these are the sort of people to read man pages over ill-informed garbage on some guy's "Linux blog", I don't know). Chris pgpqJp_1SPaUo.pgp Description: PGP signature

Re: If rbash is worthless, why not remove it and decrease bloat?

2013-03-16 Thread Chris Down
On 2013-03-16 23:06, Pierre Gaston wrote: > On Sat, Mar 16, 2013 at 6:28 PM, Chris Down wrote: > > On 2013-03-16 12:13, Chet Ramey wrote: > >> > If it cannot be removed, then some people are using it with the false > >> > expectation that it provides some i

Re: Bug/limitation in 'time'

2013-03-16 Thread Chris Down
ite easily do it on your current shell. A better way would be to write it like this: ExprCount() { for (( i = $1 ; i > 0 ; i-- )); do : done echo "$1 iterations" } Best, Chris pgpCynS2tBqL6.pgp Description: PGP signature

Re: Bug/limitation in 'time'

2013-03-16 Thread Chris Down
# This code performs quite well > function BashCount() { > i=$1 > while [ $i -gt 0 ]; do > (( i-- )) > done > echo Just did $1 iterations using bash math > } > time BashCount 15 For the record `function' and `((' are not POSIX. Chris

Re: Bug/limitation in 'time'

2013-03-16 Thread Chris Down
he official documentation are <http://mywiki.wooledge.org/BashGuide> and <http://wiki.bash-hackers.org/>. Chris pgpOlYMJkIA6i.pgp Description: PGP signature

Re: Bug/limitation in 'time'

2013-03-16 Thread Chris Down
On 2013-03-17 01:09, William Park wrote: > Are you saying that > > for (( ; ; )) > > is not POSIX? `((' is not POSIX. pgpstbEnn7hm4.pgp Description: PGP signature

Re: Bug/limitation in 'time'

2013-03-18 Thread Chris Down
On 2013-03-18 00:46, Linda Walsh wrote: > Bruce Dawson wrote: > > Chris Down pointed that out. My loop now looks like this -- portable (I > > believe) and fast: > > > > BashCount() { > > for (( i = $1 ; i > 0 ; i-- )); do > > : > >

Re: bug-report/request: allow "set +n" to re-enable commands.

2013-03-22 Thread Chris Down
For 1, use a heredoc to a noop. Sorry for the terse reply, on my phone. On 23 Mar 2013 05:07, "Richard Neill" wrote: > Dear All, > > Might I suggest/request that "set +n" should undo the effect of > "set -n" ? > > For example: > > #!/bin/bash > echo one > set -n >

Re: Local variables overriding global constants

2013-04-03 Thread Chris Down
On 2013-04-03 10:50, Nikolai Kondrashov wrote: > On 04/03/2013 10:43 AM, Chris F.A. Johnson wrote: > >On Wed, 3 Apr 2013, Nikolai Kondrashov wrote: > >>I.e. this: > >> > >>bash -c 'declare -r v; a() { declare -r v; }; a' > >> > >>

Re: Local variables overriding global constants

2013-04-03 Thread Chris Down
r v=123; a; }; b' > >> > >>Produces this: > >> > >> 123 > > > >That is *inside* the function, not *outside* the function. > > I'd say that "v" is declared outside function "a", where it is accessed, or do > you mean that there is no concept of separate functions in Bash and all > "functions" are just one function? $v is not populated at initial runtime, it is populated when it is accessed. Chris pgpJ99rQ_Absd.pgp Description: PGP signature

Re: to - Bookmark file system locations in bash on POSIX-like systems

2013-04-04 Thread Chris Down
in your configuration, and then jump around using `jump foo'. I cannot think of a time where it was useful for me to add paths during runtime, so an --add or --remove option seems pointless. Best, Chris pgpWc0nGsrcdP.pgp Description: PGP signature

Re: to - Bookmark file system locations in bash on POSIX-like systems

2013-04-04 Thread Chris Down
nd > most likely provide better running times as well. (*cough* git checkout -b > link) That is a good idea which for some reason slipped my mind. You probably will want to use cd -P. Will probably follow up with a jump implementation using symlinks, I like it. It certainly makes sense since we're dealing with paths anyway. Chris pgpW2_Ml_nB3e.pgp Description: PGP signature

Re: invoke tilde expansion on quoted string

2013-04-04 Thread Chris Down
t some more rare tilde expansions). Chris 1: http://lists.gnu.org/archive/html/help-bash/2013-02/msg00030.html pgpjEmRZlnGsT.pgp Description: PGP signature

Re: to - Bookmark file system locations in bash on POSIX-like systems

2013-04-04 Thread Chris Down
On 2013-04-04 21:05, Domingo Ignacio Galdos wrote: > Hn, I use a similar tool called ln > > In all seriousness what value does or could a tool like this add above ln? > > ln -s ~/some/long/path ~/bookmark > cd ~/bookmark > cd ~/bookmark/nested/tab/completion > rm ~/bookmark > > Sorry I don't mean t

Re: to - Bookmark file system locations in bash on POSIX-like systems

2013-04-05 Thread Chris Down
uld need to remember to use cd -P every time if you wanted to keep > things unaliased. See `set -o physical'. Chris pgpX_g_ydzayN.pgp Description: PGP signature

Re: to - Bookmark file system locations in bash on POSIX-like systems

2013-04-05 Thread Chris Down
; ln: failed to create symbolic link `rot/etc': Permission denied > > You also need to use the -n option to prevent dereferencing > $ ln -sfn /etc foo > # foo -> /etc/ > > Once you've done that though, it works well. Sorry, I thought it would be implicit that you need to also stop dereferencing. Perhaps I should have said. Chris

Re: Interpretation of escapes in expansions in pattern matching contexts

2013-04-06 Thread Chris Down
On 2013-04-06 07:01, Eric Blake wrote: > > bb: no > > jsh: no > > I haven't heard of these two, but they are also bugs. I assume bb is busybox ash. Chris pgppwY6f9jNaE.pgp Description: PGP signature

Re: Found problem mentioned in email 3/27: path interpretted/eval'd as numeric expression

2013-04-17 Thread Chris Down
On 2013-04-17 17:30, Linda Walsh wrote: > BTW, is it planned to implement exporting ARRAY and HASHES? > > Sure would simplify some programs... ;-) As if exporting functions wasn't hacky enough... pgpgq8C_hz5oQ.pgp Description: PGP signature

Re: getting weird output out of 'echo' w/args

2013-05-30 Thread Chris Down
Pierre is referring to the fact that [i++] is evaluated as a glob by the shell, the reason it doesn't work is because $i is postincremented instead of preincremented. You can see what he means here: $ shopt -u nullglob $ i=0 $ while read a[++i]; do > echo "${a[i]}" > done <<< hello hello $ sho

Re: getting weird output out of 'echo' w/args

2013-05-30 Thread Chris Down
That's... why I said he was unintentionally doing postincrement... On 30 May 2013 17:04, Davide Brini wrote: > On Thu, 30 May 2013 16:56:36 +0800, Chris Down wrote: > >> Pierre is referring to the fact that [i++] is evaluated as a glob by >> the shell, the reason it doe

Re: getting weird output out of 'echo' w/args

2013-05-30 Thread Chris Down
On 30 May 2013 17:59, Linda Walsh wrote: > Generally don't feel good about that op except in very narrow > circumstances...for exactly those types of reasons...what you > can't see CAN hurt you! ;-) It doesn't have anything to do with the operator, it's to do with the usage of square brackets t

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

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 i

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-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: 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: `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: 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: 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: Bug report command "cd"

2013-07-03 Thread Chris Down
-- --SMSBOOT-sources Or: cd ./--SMSBOOT-sources Best, Chris

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: PS1 multiline with colors

2013-07-04 Thread Chris Down
te that the control codes are zero-width (by using \[ and \]). Without them, this is expected behaviour. Better, don't hardcode the escape codes for colours -- it is a naive assumption to believe that all terminals will do what you expect. Use `tput' instead. Best, Chris

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: Error in read implementation and/or documentation

2013-07-27 Thread Chris Down
, then given EOF for one > of the first 2 characters, it still waits for all 3 characters. Cannot reproduce. $ printf 01 | read -n3 $ echo $? 1 Best, Chris

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
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: Bug in function return statement in while subshell

2013-07-29 Thread Chris Down
is seems like expected behaviour in a subshell to me (although I think it should probably raise a syntax error since return is out of context). Chris

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

Misleading phrasing about $! in documentation

2013-07-31 Thread Chris Down
6579 The pipeline with the PID referenced by $! was not executed last, it was merely backgrounded last. I suggest s/executed background/backgrounded/. If this is accepted as valid, I will happily write and attach a patch. Best, Chris pgpUkRpRHbYxG.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

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

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

  1   2   3   4   5   >