Re: feature request: printf %(%s)T

2011-11-23 Thread Eric Blake
here are probably many others. > At a guess, I would assume everything that isn't GNU/Linux or BSD. Gnulib already provides a strftime replacement that guarantees %s, which is handy since the next version of POSIX is considering requiring %s in strftime(). -- Eric Blake ebl...@redhat.com

Re: bash silently ignores additional arguments for cd

2011-12-07 Thread Eric Blake
quires that portable applications pass at most one argument to cd, such that passing more than one argument triggers unspecified behavior. We might as well make that behavior intuitive. -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: bash silently ignores additional arguments for cd

2011-12-07 Thread Eric Blake
On 12/07/2011 12:02 PM, Eric Blake wrote: > Or even nicer, behave like zsh, and treat > cd xxx yyy > like this (written assuming extglob syntax) > cd xxx+($' \t')yyy Correction: cd xxx+([$' \t'])yyy -- Eric Blake ebl...@redhat.com+1-919-301-3266 Lib

Re: "read" builtin: timeout vs. EOF

2011-12-19 Thread Eric Blake
An error occurred. Getting a timeout or invalid file descriptor should definitely be considered error cases that return > 1 (SIGALRM for timeout works well). -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

'>; ' redirection operator [was: [1003.1(2008)/Issue 7 0000530]: Support in-place editing in sed (-iEXTENSION)]

2011-12-22 Thread Eric Blake
ne '>;' redirection in the same command, and both target the same end file (whether or not by the same file name)? What happens if the command succeeds, but the rename of the temp file to the destination fails? Are there clobber ('>|') or append ('>>')

Re: bash, echo or openssl bug?

2012-01-03 Thread Eric Blake
NGlQaVF5 | openssl base64 -d echo OHBjcWNLNGlQaVF5 | openssl base64 -d && echo or modify your PS1 to start with a newline request. -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: let's set the positional parameters with a simple 'read'

2012-01-03 Thread Eric Blake
a subshell to do what you want. Just do: read p set -- "$p" to set $1, or read p set -- $p to set all of $@ according to the IFS splitting of $p. > > So I propose we 'wreck the language' to allow me to do > $ read @ > to set $@, same with 1, 2,.. * (almost t

Re: let's set the positional parameters with a simple 'read'

2012-01-03 Thread Eric Blake
n the positional parameters, use set. It's as simple as that. What's wrong with: read -a myarray set -- "${myarray[@]}" -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: string comparing and if-else character or so descriptive subject here (for reference)

2012-01-19 Thread Eric Blake
, twice. Useless use of ls and sort (globbing already gives names in sorted order, and printf as a built-in is more efficient than ls at listing one name per line). Why not: sort -n $(printf %s\\n ../usage-* | tail -n1) | \ tail -n $(wc -l < template) > top_usage > cat template top_us

Re: set -e in (subshells) does not work independently of outer context

2012-01-24 Thread Eric Blake
e' to work; there are just too many pitfalls and buggy shell implementations with differing interpretations to ever expect it to be useful, even if there is a standardized documentation for how it should behave, and even if bash has (finally) caught up to the standards. -- Eric Blake ebl...@

Re: set -e in (subshells) does not work independently of outer context

2012-01-25 Thread Eric Blake
i 0 Even though we called set -e twice (both in the parent and in the subshell), the fact that the subshell exists in a context where -e is ignored (the condition of an if statement), there is nothing we can do in the subshell to re-enable -e. -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: set -e in (subshells) does not work independently of outer context

2012-01-30 Thread Eric Blake
On 01/30/2012 02:27 PM, Linda Walsh wrote: > > > Chet Ramey wrote: > >> As Eric said, the other parts of the Posix description make it clear that >> the `ignoring set -e' status is inherited by subshells. > > > The original POSIX standard made

Re: set -e in (subshells) does not work independently of outer context

2012-02-10 Thread Eric Blake
t meets your needs, before making it part of the next version of POSIX. It's a lot easier to standardize something with a reference implementation, after all. -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: Why does BASH delay printing capitol 'T'

2012-02-13 Thread Eric Blake
function rather than treating it as a normal input character. -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: bash blocking on exec assigning an output file descriptor to a fifo

2012-02-14 Thread Eric Blake
same fifo, then you have to use a subshell and backgrounding in order to split the shell script into two processes, one reading and one writing, and recognize that whichever of the parent or subshell uses the fifo first will block until the counterpart process opens the same fifo in the other direction. -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: Fix u32toutf8 so it encodes values > 0xFFFF correctly.

2012-02-21 Thread Eric Blake
wint_t is always 32 bits, but you still have the issue that it can be either signed or unsigned. -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: Fix u32toutf8 so it encodes values > 0xFFFF correctly.

2012-02-22 Thread Eric Blake
On 02/22/2012 05:19 AM, Linda Walsh wrote: > > > Eric Blake wrote: > > >> Not only can wchar_t can be either signed or unsigned, you also have to >> worry about platforms where it is only 16 bits, such as cygwin; on the >> other hand, wint_t is always 32 bits,

Re: Initial test code for \U

2012-02-22 Thread Eric Blake
nywhere. C.UTF-8 exists on Cygwin. But you are correct that... > en_US.UTF-8 seems > to perform acceptably for the latter. -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: Fix u32toutf8 so it encodes values > 0xFFFF correctly.

2012-02-22 Thread Eric Blake
e values; but using such values has unspecified results on any interface that takes a wint_t. WEOF only has to be distinct, it does not have to be negative. Don't think of it as 'wide-int', rather, think of it as 'the integral type that both contains wchar_t and WEOF'. Y

Re: Fix u32toutf8 so it encodes values > 0xFFFF correctly.

2012-02-22 Thread Eric Blake
OSIX but not C99 to handle the new character types. -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: Fix u32toutf8 so it encodes values > 0xFFFF correctly.

2012-02-22 Thread Eric Blake
On 02/22/2012 10:02 PM, Linda Walsh wrote: > > > Eric Blake wrote: > >> >> Don't think of it as 'wide-int', rather, think of it as 'the integral >> type that both contains wchar_t and WEOF'. You cannot write 'signed >> wint_t&#

Re: previous command v whitespace following prompt

2012-02-27 Thread Eric Blake
t it gave me the before > previous one. > Is this a bug? No, it is probably intentional. According to the documentation of HISTCONTROL, if you have the ignorespace option set in your history control, then use of leading whitespace exempts that command from being tracked in history. -- Eric

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread Eric Blake
les. That's the only sane approach. > > Or show me how without using variables > to do this > test=test\'string > > [ "${test}" = "${test//"'"/"'"}" ] || exit 999 exit 999 is pointless. It is the same as exit 231 on some shells, and according to POSIX, it is allowed to be a syntax error in other shells. -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: bash 4.2 breaks source finding libs in lib/filename...

2012-02-29 Thread Eric Blake
not, quit complaining) that would add a new shopt, off by default, to allow your desired alternate behavior. But I won't write such a patch, and if such a patch is written, I won't use it, because I'm already used to the POSIX behavior. -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-29 Thread Eric Blake
specified by POSIX. So the question becomes whether it is smarter to follow the rules for ${test+...} or for ${test%...} (alas, POSIX does indeed have different rules for determining how " is treated and how '}' is found in those two setups). -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: test builtin of bash is not using nanosecond timestamps

2012-03-06 Thread Eric Blake
> of the stat structure specified in POSIX.1-2008. The patch included >> shouls add the comparision of the nanosecond timestamps. > > Thanks for the report. Unfortunately, the way different versions of Unix > name the `struct timespec' members of struct stat v

Re: [bug] Home dir in PS1 not abbreviated to tilde

2012-03-13 Thread Eric Blake
th approaches will misbehave if HOME is a root directory (/ or //), where you _don't_ want to strip trailing slashes. So you really want: case $HOME in *[^/]* ) HOME=${HOME%${HOME##*[^/]}} ;; esac -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [bug] Home dir in PS1 not abbreviated to tilde

2012-03-13 Thread Eric Blake
On 03/13/2012 09:27 AM, Eric Blake wrote: > Be aware that both approaches will misbehave if HOME is a root directory > (/ or //), where you _don't_ want to strip trailing slashes. So you > really want: > > case $HOME in > *[^/]* ) HOME=${HOME%${HOME##*[^/]}} ;; >

Re: [bug] Home dir in PS1 not abbreviated to tilde

2012-03-13 Thread Eric Blake
On 03/13/2012 09:47 AM, dethrophes wrote: > Am 13.03.2012 16:42, schrieb Eric Blake: >> On 03/13/2012 09:27 AM, Eric Blake wrote: >>> Be aware that both approaches will misbehave if HOME is a root directory >>> (/ or //), where you _don't_ want to strip trailing

Re: [bug] Home dir in PS1 not abbreviated to tilde

2012-03-13 Thread Eric Blake
performing negation, but other shells treat ^ literally). Additionally, since POSIX requires tilde-expansion to occur on the word after 'case', you can write this as: case ~ in *[!/]* ) HOME=${HOME%${HOME##*[!/]}} ;; / | // ) ;; *) HOME=/ ;; esac -- Eric Blake ebl...

Re: function invoking alias fails if defined in same conditional

2012-03-17 Thread Eric Blake
arate > aseparate > $ atogether > atogether > $ ftogether > bash: atogether: command not found This behavior is expected, and not a bug. -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: Determine if a file is a valid Bash script

2012-03-19 Thread Eric Blake
even older, on SunOS 4, you could make '/bin/sh -n' go into an infinite loop on a script as simple a while loop that never executes. More recently, modern ksh '-n' warns about every suspicious construct, such as complaining about `` instead of $(). And don't ever try &#

Re: Bash $@ expansion undocumentedly ignoring '

2012-03-21 Thread Eric Blake
quoted the ' characters by surrounding the overall argument in "". > # > # This is non-standard/unexpected behaviour. > > echo $@ Bug in your script - you generally want to use "$@", not $@, as the former replays the positional parameters exactly, while the lat

Re: Brace expansion bug

2012-03-26 Thread Eric Blake
say whether it's right or wrong; you can only say whether it behaves as bash documented it to behave. -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: locale specific ordering in EN_US -- why is a

2012-05-21 Thread Eric Blake
X 2001 already allows RRI as part of its recognition that the decision made in POSIX 1992 causes pain when coupled with poorly-written locale definitions. For example, here is an RRI patch for gnulib: https://lists.gnu.org/archive/html/bug-gnulib/2012-04/msg00185.html -- Eric Blake ebl.

Re: locale specific ordering in EN_US -- why is a

2012-05-21 Thread Eric Blake
ranges are currently unspecified in all but the C locale; the RRI project is attempting to make it sane across all locales within the scope of GNU programs, but it takes time to write and approve the patches necessary to get to that point. -- Eric Blake ebl...@redhat.com+1-919-301-3

Re: locale specific ordering in EN_US -- why is a

2012-05-21 Thread Eric Blake
-- > Seems pretty clear -- regex's aren't exempt from collating order, they > depend on it... Only on platforms where libc has chosen to provide an extension beyond POSIX, and where GNU programs have not further overridden things to avoid the unexpected glibc semantics. --

Re: handling of test == by BASH's POSIX mode

2012-05-28 Thread Eric Blake
w.php?id=375 at which point, the use of == would be required to work. -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: handling of test == by BASH's POSIX mode

2012-05-28 Thread Eric Blake
d**) would be better if bash chose > to fail, while executing in POSIX mode, in this case. Sounds like you want debian's 'posh', which is even stricter than 'dash', and excellent for pointing out use of extensions by failing loudly at any encountered extension

Re: Red-Hat Bug 825751 - bash-completion fails on environment variables

2012-06-07 Thread Eric Blake
On 06/07/2012 03:22 PM, Linda Walsh wrote: > This isn't a matter of preference... its a real bug. > > Ex: > $ ls $HOME/bin > "ls: cannot access $HOME/bin: No such file or directory" Yes, we know. Ergo patch 29: https://lists.gnu.org/archive/html/bug-bash/2012-05

Re: Massive recursion -> SEGV

2012-07-02 Thread Eric Blake
the only recovery possible after detecting stack overflow is a graceful message and exit unless you go to extreme lengths to block signals around every call to malloc or any other library function that grabs a lock. -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt virtualization library

Re: Doc of "set -e" should mention non-locality

2012-07-04 Thread Eric Blake
. At least on AIX, ksh and sh do so. Only because they haven't been patched to obey POSIX yet. > > * The average shell programmer probably seldomly encounters > the difference, because it rarely matters. Actually, the average shell programmer should avoid 'set -e', be

Re: Doc of "set -e" should mention non-locality

2012-07-04 Thread Eric Blake
'tc1-2008' tag). > > Thanks for pointing to that issue record. > Is this part of the standard yet? Assuming balloting goes well, it will be later this year, but bash proactively already implemented it. -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: readline expansion: 'cp $v/' -> 'cp \$v/' (no expansion) - why?

2012-07-05 Thread Eric Blake
inux ubuntu 12.04) ? Yep - upgrade to bash 4.2.29 (that is, patchlevel 2 is missing the fix in patchlevel 29 that restores the behavior you want). ftp://ftp.gnu.org/pub/gnu/bash/bash-4.2-patches/bash42-029 This topic comes up frequently on this list. -- Eric Blake ebl...@redhat.com+1-919-301-32

Re: Why does -v not work until after "}" in scripts?

2012-07-30 Thread Eric Blake
havior. -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: Shell comment ignored

2012-08-16 Thread Eric Blake
ep, and that is correct behavior as mandated by POSIX. -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: bash 4.x filters out environmental variables containing a dot in the name

2012-08-21 Thread Eric Blake
requires that '.' is not part of a valid variable name. Just because ksh allows it as an extension to POSIX does not mean that bash has to do likewise. -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: Undocumented behaviour - parameter expansion ${par-word}

2012-09-04 Thread Eric Blake
rameter is substituted. It's a shame that the form ${parameter-word} is not called out more directly in a form easy to search for, and that you have to read in two places to piece things together yourself; but it IS supported and documented. -- Eric Blake ebl...@redhat.c

Re: set -e behaviour. Seems bug. Not the subshell issue!

2012-09-11 Thread Eric Blake
onforms to POSIX. > > Is any way to force "set -e" to work even in such cases? No, it is already working as specified (just not the way you want). > > If this question asked 1000 times, why not to answer in FAQ ( > http://tiswww.case.edu/php/chet/bash/FAQ)? http://mywiki.w

Re: set -e behaviour. Seems bug. Not the subshell issue!

2012-09-11 Thread Eric Blake
n bodies, but only inside function bodies where the function call appears inside a context where 'set -e' is ignored (such as in the condition of 'if'). It's non-intuitive, and therefore my advice is to never rely on 'set -e'. -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: Parsing error when "case" in "for" in $()

2012-09-11 Thread Eric Blake
at line 1: `;;' unexpected but not in mksh or dash: # dash -c 'echo $(for x in whatever; do case y in *) echo 42;; esac; done) ' 42 Looks like you found a real bug, but a tough one to fix if even ksh gets it wrong. -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt

Re: Parsing error when "case" in "for" in $()

2012-09-11 Thread Eric Blake
t; open paren as syntactic sugar... POSIX has always required an optional open paren to case patterns, thanks to ksh; but it hasn't been portable to all shells until recently (among others, Solaris /bin/sh will fail if you try it, but then again, that's not a POSIX shell). -- E

Re: Bash dumps stack after writing to /etc

2012-09-21 Thread Eric Blake
' -DCONF_VENDOR='pc' > -DLOCALEDIR='/usr/$ > uname output: CYGWIN_NT-6.1 Machine-name 1.7.16(0.262/5/3) 2012-07-20 22:55 > i686 Cygwin > Machine Type: i686-pc-cygwin Have you reproduced this on non-cygwin platforms, or should you be reporting this to the cygwin fo

Re: a recursion bug

2012-10-03 Thread Eric Blake
very easy to detect user-induced stack overflow with a minimum amount of additional code. Both GNU m4 and gawk have used libsigsegv to implement nicer error handling in this situation, so maybe it is worth copying code from these projects into bash. -- Eric Blake ebl...@redhat.com+1-91

Re: examples/loadables/getconf.c

2012-10-05 Thread Eric Blake
g type converted according to the integer promotions. and are the two main headers that are this explicit about various macros being suitable for use in preprocessor arithmetic, and preprocessor arithmetic cannot use casts or sizeof. -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvir

Re: examples/loadables/getconf.c

2012-10-05 Thread Eric Blake
On 10/05/2012 10:17 AM, Eric Blake wrote: > On 10/05/2012 10:06 AM, Andreas Schwab wrote: >> Chet Ramey writes: >> >>> Why would you say there's a restriction against using casts or sizeof in >>> a macro like this? >> >> Because it must e

Re: examples/loadables/getconf.c

2012-10-05 Thread Eric Blake
On 10/05/2012 10:50 AM, Eric Blake wrote: >> and are the two main headers that are this >> explicit about various macros being suitable for use in preprocessor >> arithmetic, and preprocessor arithmetic cannot use casts or sizeof. > > And I think this is a bug in POSI

Re: different exit codes in $? and ${PIPESTATUS[@]}

2012-10-12 Thread Eric Blake
> ok. Consider: $ f() { return 2; } $ ! f $ echo $? ${PIPESTATUS[@]} 0 2 If PIPESTATUS included the effect of !, you would only ever be able to see 0 or 1; but by having it be the uninverted status, you can see the full 0-255 of the actual command prior to the inversion. -- Eric Blake ebl...@

Re: devel branch build failure

2012-12-12 Thread Eric Blake
tab.[ch]) that must exist in the tarball but can be safe to omit from git, if we are willing to assume that developers building from git can be assumed to have the maintainer tools. Treating git like building from a tarball is not necessarily worth the headache. -- Eric Blake eblake redhat com

Re: why does errexit exist in its current utterly useless form?

2012-12-14 Thread Eric Blake
you are in a context that ignores 'set -e', the historical behavior is that there is no further way to turn it back on, for that entire body of code in the ignored context. That's how it was done 30 years ago, before shell functions were really thought about, and we are stu

Re: No such file or directory

2013-01-02 Thread Eric Blake
n the common case) than what the man pages says is possible in the more comprehensive case. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: Is direxpand available yet (to fix dirspell)?

2013-01-10 Thread Eric Blake
eam binary from your distro of choice). You can also look at git://git.sv.gnu.org/bash.git, but it is a bit behind; Chet has only pushed master up to patch 39 instead of patch 42. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc

Re: Command line arguments depend on locale

2013-01-31 Thread Eric Blake
d manner for specifing orthogonal locales for transliterating floating point from one representation to another seems like a missing feature in POSIX. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: export in posix mode

2013-02-27 Thread Eric Blake
ix mode does not require bash to instantly prohibit extensions. POSIX intentionally allows for implementations to provide extensions, and 'export -n' is one of bash's extensions. There's no bug here, since leaving the extension always enabled does not conflict with subset of

Re: export in posix mode

2013-02-27 Thread Eric Blake
t; 1 I tested with posh 0.10.2; looks like this is an upstream regression in behavior (although you'd have to ask posh developers whether the regression is intentional): $ posh -c 'exit 10'; echo $? 10 -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualizati

Re: [PATCH] Adding support for '--' in builtin echo's option parsing.

2013-04-01 Thread Eric Blake
y it seems to be impossible to e.g. print "-n" with the > builtin > echo witout any extra characters. > > Repeat-By: > Invoke echo with the string "-n" being the string to be outputted. > Expected output: "-n" NACK.

Re: [PATCH] Adding support for '--' in builtin echo's option parsing.

2013-04-01 Thread Eric Blake
shall not recognize the "--" argument in the manner >> specified by Guideline 10 of XBD Utility Syntax Guidelines ; "--" >> shall be recognized as a string operand. > > Perhaps this is worth adjusting unless POSIXLY_CORRECT? No. Existing scripts alr

Re: invoke tilde expansion on quoted string

2013-04-04 Thread Eric Blake
eval. > else > # No, $1 doesn't contain slash > eval $1="${!1}" > fi > fi > } # __expand_tilde_by_ref() > > ---8<--- $ foo='~;$(date)' $ __expand_tilde_by_ref foo bash: Thu: command not found... If you're going to use eval, you MUST SANITIZE THE INPUT. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: invoke tilde expansion on quoted string

2013-04-04 Thread Eric Blake
the > same way that bash performs tilde expansions, and that it was safe to > ignore tilde expansions in inputs of the form "hostname:~username/pathname" > and "variable=~username/pathname".) But those more complex problems should still be solvable (as an

Re: Interpretation of escapes in expansions in pattern matching contexts

2013-04-06 Thread Eric Blake
.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_13. Thos rules state that any character in the pattern that is quoted (which \x is) matches itself, and 'x' matches 'x'. > ksh: yes correct > mksh: no bug > posh: no bug > zsh: no bug &g

Re: RFE: capture command AND output for display and/or redirection

2013-04-23 Thread Eric Blake
/html/help-bash/2013-04/msg00031.html In particular, that thread points out: http://mywiki.wooledge.org/BashFAQ/050 -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: RFE: capture command AND output for display and/or redirection

2013-04-29 Thread Eric Blake
st to make our lives bit more > comfortable? Did you not read the FAQ entry, which mentions that a DEBUG trap that collects $BASH_COMMAND (both bash extensions) exists as the nicest way to trace what your script did, and can be used in a way that doesn't interfere with the stdout/stderr that

Re: Obsolete SIGRTMAX-n signal names

2013-05-29 Thread Eric Blake
ill providing ABI compatibility for older applications to continue to run even without recompilation). -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: bug batch

2013-06-13 Thread Eric Blake
Whether various shells have extensions that attempt to treat the command as arithmetic or fall back to command substitution is a different matter, since POSIX doesn't forbid extensions. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: locale specific ordering in EN_US -- why is a

2013-06-28 Thread Eric Blake
bc. Until that bug is solved, we can work around > it by providing replacement code. Working around the bug by recompiling 20 separate apps is more painful and less maintainable than just fixing the bug at the source. Please, add your opinions to the glibc list to help convince the glibc lo

Re: Bash install on Windows 7 using SUA

2013-07-02 Thread Eric Blake
s, and no one else has ever tried working around that bug. SUA is a rather wimpy porting platform. Have you considered trying Cygwin instead (see cygwin.com), so that you don't have to put up with all the non-conforming incomplete POSIX garbage that Microsoft is pushing with their SUA platfor

Re: Bug report command "cd"

2013-07-03 Thread Eric Blake
-SMSBOOT-sources-/* cd ./--SMSBOOT-sources-/* This is true for most unix-y commands, not just cd. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: having bash display real tabs for tab characters...

2013-07-11 Thread Eric Blake
speak louder than words; right now, your insistence on reviving dead threads and complaining that no one is writing the patches is rather annoying. Quit beating a dead horse; if you want action, start proposing patches rather than rants. -- Eric Blake eblake redhat com+1-919-301-3266 L

Re: -a vs -e

2013-09-05 Thread Eric Blake
nstance where -a is parsed as a binary operator (ie. it was parsed as "\( ! \) -a \( stuff.txt \)", not "! \( -a stuff.txt \)". -a as a binary operator is required by POSIX for XSI, therefore it takes priority over -a as a unary operator as a bash extension. -- Eric Blake e

Re: -a vs -e

2013-09-05 Thread Eric Blake
>> >> Fedora 18, bash 4.2.45(1)-release >> OSX, 3.2.48(1)-release > > Also occurs in 4.3.0-beta. Which is good, because it's not a bug. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: -a vs -e

2013-09-05 Thread Eric Blake
[moving to the coreutils list, as coreutils has a bug here] On 09/05/2013 10:33 AM, Eric Blake wrote: > On 09/04/2013 11:06 PM, kneuf...@gmail.com wrote: >> According to the man page, [ -a ] and [ -e ] should have the same behaviour. > > Not a bug. -a behaves like -e

Re: "echo [warning]" geeft "a"

2013-09-30 Thread Eric Blake
ample $ echo [warning] [warning] $ touch a $ echo [warning] a $ touch n $ echo [warning] a n $ echo "[warning]" [warning] This is not a bug in bash, but in your script. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: -e and permission denied

2013-10-03 Thread Eric Blake
ll intents and purposes, if you don't have permission to stat a file, then it may as well not exist. Treating permission denied as not existing is perfectly logical. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: -e and permission denied

2013-10-03 Thread Eric Blake
On 10/03/2013 04:19 PM, vic...@vsespb.ru wrote: > пятница, 4 октября 2013 г., 2:11:51 UTC+4 пользователь Eric Blake написал: >> For all intents and purposes > > What about the following intent: > -if file exists, backup file > -throw an error in case of permission problem (t

Re: -e and permission denied

2013-10-03 Thread Eric Blake
d write your script to error out if a user feeds you a name that you cannot access. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: -e and permission denied

2013-10-04 Thread Eric Blake
f you care about the difference between ENOENT and EPERM, then write your program in C or other language, not shell. There is no way for the shell to tell you what errno the OS returned. The shell is not going to change just because of your request. -- Eric Blake eblake redhat com+1-919-

Re: Reproducible SIGSEGV in bash 4.2 caused by alias.

2013-10-10 Thread Eric Blake
dump upon stack overflow (although gracefully recovering from overflow is a MUCH harder task, unless you can prove that overflow will never happen in the middle of a function such as malloc). -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org s

Re: [BUG] directory tree error (probably)

2013-10-15 Thread Eric Blake
sing "//" as the root of the "//system/share" path notation for accessing other computers on the same network. While Linux happens to have an implementation definition that "//" and "/" are identical, bash has chosen that it is easier to always handle "//"

Re: Local envvar remaining after function call

2013-10-15 Thread Eric Blake
in addition to its current dynamic scoping) for that to work. So in the meantime, yes, bash really does behave non-intuitively when in posix mode. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

bug-bash@gnu.org

2013-10-28 Thread Eric Blake
pattern, but I know it is limited in functionality. I.e.: > > ls !($(echo *+(-IGN-)*|tr " " "|")) for $var in *; do case $var in *-IGN-*) ;; *) # whatever you wanted on the remaining files ;; esac done -- Eric Blake eblake redhat com+1-919

bug-bash@gnu.org

2013-10-28 Thread Eric Blake
7;luck'? > --- > Slight improvement -- but still not a direct bash pattern: > > !($(printf "%s|" *+(-IGN-)*)) What's wrong with: !(*-IGN-*) -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: RFC: turn off word splitting for vars but keep for read

2013-11-22 Thread Eric Blake
ve shell is one thing (and in fact, zsh has done that in their default mode), but for scripting, you would break LOTS of existing scripts if you changed the default behavior of word splitting. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org

Re: why are \d and \D not implemented but don't throw errors in regex?

2013-12-10 Thread Eric Blake
al problem with libpcre is that it is bloat: bash is already bigger than dash, and requiring yet another third party library will further swing the balance away from bash for the systems that want their POSIX 'sh' to be small rather than bloated. -- Eric Blake eblake redhat com+1-

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

2014-01-13 Thread Eric Blake
t be used often enough to provide more gains than the cost of learning it. In particular, I will refuse to use any system that requires a web browser in order to submit or modify status of a bug (ie. any GOOD bug tracker system needs to still interact with an email front-end). -- Eric Blake eblake

Re: When a hashed pathname is deleted, search PATH

2014-03-14 Thread Eric Blake
ell shall repeat the search to find the new location for the utility, if any." So the three ways to reset a hash without resorting to the non-portable shopt are 'hash -r', 'PATH=$PATH', or causing lookup to fail - but bash is not honoring the third way by default

Re: unnecessary {de,}alloc wrappers?

2014-04-01 Thread Eric Blake
on for this one; probably just extremely old legacy code back in the day when various libc were not compatible to the restrictions added in later versions of the C standard. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: unnecessary {de,}alloc wrappers?

2014-04-01 Thread Eric Blake
tf.c: if (tmp_roomptr != NULL) free (tmp_roomptr); > > Either way, I find both of these code snippets very redundant. As do I, but I'm not the one in charge of deciding whether to clean the code base up to satisfy the useless-if-before-free script. -- Eric Blake eblak

Re: bash-4.3 bug report

2014-04-14 Thread Eric Blake
the out-of-bounds access will read unspecified memory, but the result of that read will either be 0 (short-circuiting the bounds check) or non-zero where the bounds check fails, so even if you leave the undefined behavior in place, in practice you will usually get the same result as the defined behavior

Re: bash-4.3 bug report

2014-04-14 Thread Eric Blake
On 04/14/2014 09:26 AM, Andreas Schwab wrote: > Eric Blake writes: > >> It silences static code checkers and avoids undefined C behavior. >> >> Also, if invokers[] is allocated such that it ends on the end of a page >> boundary (such as might be the case under cert

Re: bash-4.3 bug report

2014-04-14 Thread Eric Blake
On 04/14/2014 09:35 AM, Andreas Schwab wrote: > Eric Blake writes: > >> In that case, the index check is dead code, > > No. You don't understand. Fair enough. But my point remains to the original poster: a patch without justification is unlikely to be applied. Doc

<    1   2   3   4   5   6   7   >