Re: String replacements leak small amounts of memory each time

2010-06-23 Thread Matthew Woehlke
Chet Ramey wrote: On 6/22/10 6:57 PM, Matthew Woehlke wrote: No question something bad is going on here. You're right. I found and fixed it. It wasn't where I was looking initially. The fix will be in the next bash release and may come out as a patch. Also, when run under valgr

Re: String replacements leak small amounts of memory each time

2010-06-22 Thread Matthew Woehlke
oyvi...@dhampir.no wrote: Description: When used in a script that iterates over several thousand lines of logs or similar data, the bash string replacement functions seem to leak memory. The Repeat-By list uses "ls -lR" to generate input, but any data will do (try your system logs) Repeat-By:

Re: how does escaping in "`...`" work?

2010-06-07 Thread Matthew Woehlke
Eric Blake wrote: On 06/07/2010 04:47 PM, Matthew Woehlke wrote: But this does not: $ echo "`echo \"you don\'t say\"`" you don\'t say \' is not special inside ``. If it is not special, then the \ is preserved on to the nested command. Bash's beh

Re: how does escaping in "`...`" work?

2010-06-07 Thread Matthew Woehlke
Bob Proulx wrote: Matthew Woehlke wrote: How should bash interpret escapes in constructs like "`...`"? The quoting rules for backticks are complex enough that the entire construct has long been replaced with a completely different one. I strongly suggest that instead of struggling

how does escaping in "`...`" work?

2010-06-07 Thread Matthew Woehlke
(See also https://bugs.kde.org/show_bug.cgi?id=237675) How should bash interpret escapes in constructs like "`...`"? For example, this do what I would expect: $ echo "`echo "you don't say"`" you don't say (That is, the contents in ``'s are parsed independent of any other context, except t

Re: Passing variables by reference conflicts with local

2010-05-03 Thread Matthew Woehlke
Freddy Vulto wrote: # Param: $1 �variable name to return value to # Public library function blackbox() { local __1 _blackbox __1 [[ $1 == __1 ]]&& echo "ERROR: variable name conflicts"\ "with local variable: $1" printf -v $1 %s

Re: Query regarding ${parameter:-word} usage

2009-12-23 Thread Matthew Woehlke
Mun wrote: I am moving from ksh93 to bash and have a question regarding the usage of ${parameter:-word} parameter expansion. In ksh, I use ${*:-.} as an argument to commands. For example: function ll { ls --color -Flv ${*:-.} } This technique passes '.' as an arg to 'ls' if

Re: add a way to declare global variables

2009-12-11 Thread Matthew Woehlke
konsolebox wrote: I hope the development team will also consider adding a way in bash to declare global variables inside a function perhaps either with an option in typeset or declare like -g (same as zsh) and/or a builtin function like global as similar to local. I thought variables in functio

Re: redirection after braced block

2009-10-05 Thread Matthew Woehlke
clemens fischer wrote: Andreas Schwab wrote: clemens fischer writes: I have the following construct in a script: ... a number of commands { ... a number of commands } 2>&1 | ${prog_log} "${logfile}" It seems anything inside the braces is not seen by bash, and it doesn't show up

Re: feature-request: brief syntax for $(type -p somecommand)

2009-04-06 Thread Matthew Woehlke
Mike Coleman wrote: It would be nice if there was some really brief syntax for $(type -p somecommand) p() { local what=$(type -p $1) shift 1 "$@" "$what" } p foobar ls -l p foobar strings ...etc also, 'complete -c p' -- Matthew Please do not quote my e-mail address unobfuscated in mes

Re: using mapfile is extreamly slow compared to oldfashinod ways to read files

2009-04-06 Thread Matthew Woehlke
Chet Ramey wrote: I'm sure there are efficiency improvements possible in the bash indexed array implementation, but sequentially accessing a data structure optimized for space and sparse arrays is never going to be as fast as a read-process loop, and that difference becomes more and more apparent

Re: Install Bashdb and Bash not as root

2009-03-13 Thread Matthew Woehlke
lehe wrote: 1. The change to PATH is effective only in the current shell session. I was wondering if it is possible to run the new bash instead of the old one everytime it is lauched in terminal, putty and in emacs. Is there a place where the change to PATH could be added and executed before bash

Re: EOF disowns background jobs?

2009-03-13 Thread Matthew Woehlke
Chet Ramey wrote: Sven Mascheck wrote: I'd expect real daemons to detach from the terminal and create a new session / new process group. Or is it, that just too few actually do? Let's just say the situation is much better than it was in the past. Sven: I should point out that a more practic

Re: EOF disowns background jobs?

2009-03-12 Thread Matthew Woehlke
Chet Ramey wrote: Matthew Woehlke wrote: $ some-command & $ ^D (bash exits, leaving some-command running) Is this what is supposed to happen? Just asking because it made me go "huh?"; I was expecting some-command to get SIGHUP'd. Yes, that's what's supposed

EOF disowns background jobs?

2009-03-11 Thread Matthew Woehlke
$ some-command & $ ^D (bash exits, leaving some-command running) Is this what is supposed to happen? Just asking because it made me go "huh?"; I was expecting some-command to get SIGHUP'd. -- Matthew Please do not quote my e-mail address unobfuscated in message bodies. -- Microsoft has become

Re: Migrating from tcsh to bash (issues)

2009-02-05 Thread Matthew Woehlke
Simos wrote: Regarding printexitvalue, I use trap '__exit_value_bashrc=$?; if [ $__exit_value_bashrc -ne 0 ]; then echo "Exit $__exit_value_bashrc"; fi' ERR so that an exit value is printed when it is other than 0. That shouldn't be necessary. An exit of 0 is not considered an error, and so

Re: truncating the path in the bash prompt?

2009-01-15 Thread Matthew Woehlke
Paul Jarc wrote: Matthew Woehlke wrote: Actually, a feature that would be REALLY helpful is a way to specify certain directory strings that should be abbreviated. PS1='...$(mypath)...' mypath() { case $PWD/ in /usr/local/src/kde/svn/trunk/*) printf %s "${PWD/#\/

Re: truncating the path in the bash prompt?

2009-01-14 Thread Matthew Woehlke
Dan Nicolaescu wrote: Dan Nicolaescu writes: > In tcsh %c can be used to only show the last few directory names in a > path (also see the ellipsis variable). > > For example for this directory: > > /lib/modules/2.6.21-1.3194.fc7/kernel/drivers/char/hw_random/ > > the promp

Re: Bash-4.0-rc1 available for FTP

2009-01-12 Thread Matthew Woehlke
Chet Ramey wrote: Matthew Woehlke wrote: Chet Ramey wrote: f. Changed behavior so the shell now acts as if it received an interrupt when a pipeline is killed by SIGINT while executing a list. Does this mean that $ sleep 60 ; do-something ...will no longer run 'do-something' whe

Re: Bash-4.0-rc1 available for FTP

2009-01-12 Thread Matthew Woehlke
Chet Ramey wrote: f. Changed behavior so the shell now acts as if it received an interrupt when a pipeline is killed by SIGINT while executing a list. Does this mean that $ sleep 60 ; do-something ...will no longer run 'do-something' when ctrl-C'd? -- Matthew Please do not quote my e-mail

Re: Is this a bash wildcard bug?

2008-11-20 Thread Matthew Woehlke
Matthew Woehlke wrote: grendelos wrote: So this is really bugging me. Why is [a-z] not case sensitive, but [A-Z] is? For example: # ls -l total 0 -rw-r--r-- 1 root root 0 Nov 20 12:22 xa -rw-r--r-- 1 root root 0 Nov 20 12:22 xA # ls -l x[a-z] -rw-r--r-- 1 root root 0 Nov 20 12:22 xa -rw-r

Re: Is this a bash wildcard bug?

2008-11-20 Thread Matthew Woehlke
grendelos wrote: So this is really bugging me. Why is [a-z] not case sensitive, but [A-Z] is? For example: # ls -l total 0 -rw-r--r-- 1 root root 0 Nov 20 12:22 xa -rw-r--r-- 1 root root 0 Nov 20 12:22 xA # ls -l x[a-z] -rw-r--r-- 1 root root 0 Nov 20 12:22 xa -rw-r--r-- 1 root root 0 Nov 20

Re: [Fwd: [PATCH] arithmetic -> logical shift]

2008-10-27 Thread Matthew Woehlke
Pádraig Brady wrote: Also arithmetic right shift is not useful. While SAR (shift arithmetic right) is technically redundant with IDIV (integer divide), it's important in C programming where it is often used as an optimized special case of the latter. While this may not be especially importan

Re: Puzzling discrepancy in bash variables

2008-10-15 Thread Matthew Woehlke
RMMM wrote: RMMM wrote: As far as I can tell, the variables $filenames and $filenames1 have the same values. Yet, they behave differently when used in an argument. Is there some hidden aspect to a bash variable that I'm not seeing? I just figured out the problem. I was running this in a shel

Re: Multiple Words on Bash Programmable Auto Completion

2008-10-02 Thread Matthew Woehlke
Chet Ramey wrote: Chet Ramey wrote: How come you didn't mention '-o nospace' when I was trying to write a completion for directory names from a non-PWD reference point? ;-) Did it exist then? :-) Did it not? I'm running 3.2-22.fc9 (3.2.33(1)-release). I'm referring to the thread http://pe

Re: Multiple Words on Bash Programmable Auto Completion

2008-10-02 Thread Matthew Woehlke
Chet Ramey wrote: Description: I don't know if this is a bug or not, but it has to do with programmable auto completion. Whenever the options have multiple words I don't get what I want. You can get filename-like quoting by specifying that readline should treat the matches returned by the c

Re: Screen Corruption when browsing Command History with Custom Prompt

2008-09-09 Thread Matthew Woehlke
Ashley Wilson wrote: No, Wait! That's not the issue!! This works just fine: PS1="\n\[\e[0;32m\]\u: \w\n# \[\e[m\]" So, all I had to do was to add '\[' before and '\]' after the coloring sequence to fix everything! Of course it works; this is exactly what Chet was trying to tell you.

Re: completing dir names for a certain path?

2008-08-25 Thread Matthew Woehlke
Chet Ramey wrote: Matthew Woehlke wrote: Because "for some reason, non-trivial completions never seem to want to work for me"? Sigh. Ok, after trying for entirely too long, this seems to be working: completeme() { local i=0 while read l; do COMPREPLY[$((++i))]="$l"

Re: completing dir names for a certain path?

2008-08-22 Thread Matthew Woehlke
Chet Ramey wrote: Matthew Woehlke wrote: I have a function 'cs' that roughly looks like 'cd /some/prefix/$*', that I would like to have completion for. Any tips? (For some reason, non-trivial completions never seem to want to work for me :-(.) Why not write a shell functi

completing dir names for a certain path?

2008-08-22 Thread Matthew Woehlke
I have a function 'cs' that roughly looks like 'cd /some/prefix/$*', that I would like to have completion for. Any tips? (For some reason, non-trivial completions never seem to want to work for me :-(.) IOW, if /some/prefix has the directories 'foo' and 'bar', I would like: $ cs b ...to complet

Re: CDPATH reports to stdout and even non-interactively

2008-08-15 Thread Matthew Woehlke
Geoff Kuenning wrote: I don't mean that the shell should ignore ALL environment variables; that would break a ton of scripts. Even ignoring PATH would be a Very Bad Thing, since we've long ago grown used to inheriting PATH. Ignoring PATH would make life much, MUCH harder. I just finished writi

Re: One cant insert a single quote into a variable with built-in substitution.

2008-08-01 Thread Matthew Woehlke
Damien Nadé wrote: I've tried to insert a single quote into a variable content. With something like this : bash-3.2$ foo=bar bash-3.2$ echo "${foo/%/'}" > If you look at that, you understand that > is the $PS2, so it means that bash is interpreting the single quote a special char. So, nat

Re: Waiting for outpu

2008-06-11 Thread Matthew Woehlke
stoyboy wrote: I am trying to create a script that will run continuously until the out of a command reaches a specific point. I have a command called showOutput and all it does it output the progress of running job, i want to create a script or a command that will process this output and do somet

Re: range match works incorrect

2008-06-05 Thread Matthew Woehlke
Roman Rakus wrote: When trying to match files [a-z] bash find files A-Z, depending on LC_COLLATE. The mistake is in usage of strcoll()/wcscoll(). It has nothing to do with ranges. Instead should be used fnmatch(). I can try to change this behavior. Or is this planned/done for next bash release?

Re: TZ=... date affected PROMPT_COMMAND

2008-04-17 Thread Matthew Woehlke
Chet Ramey wrote: Assuming you're using bash-3.1.x, that could, as Chet suggested, be the problem; I don't have a 3.1 handy to test. It is the problem. I'll take your word for it. You had previously stated that 3.2 fixed something, but not if "something" was introduced in 3.1, so I wasn't s

Re: TZ=... date affected PROMPT_COMMAND

2008-04-17 Thread Matthew Woehlke
[EMAIL PROTECTED] wrote: OK, now using Archimerged's cleaner version, I bet Matthew can reproduce this. Nope, and you still didn't answer my question, which was "what version are you using"? I'm going to guess all that is needed to reproduce for you is 'PS1="\W\$ "'. Assuming you're using b

Re: TZ=... date affected PROMPT_COMMAND

2008-04-16 Thread Matthew Woehlke
[EMAIL PROTECTED] wrote: Never thought that putting TZ here would infect my prompt, 21:07 ~$ date Wed Apr 16 21:07:54 CST 2008 21:07 ~$ TZ=America/Chicago date Wed Apr 16 08:08:07 CDT 2008 08:08 ~$ set a b c 08:08 ~$ date Wed Apr 16 21:08:22 CST 2008 21:08 ~$ all the way until the next non buil

Re: A few man page fixes from RHEL-5

2008-02-04 Thread Matthew Woehlke
Andreas Schwab wrote: Matthew Woehlke <[EMAIL PROTECTED]> writes: Doesn't 'exec' replace the process? I get the others (I think), but I don't understand what shell is left to "stop execution" after an exec. exec can fail. D'oh, fail to *do* anything

Re: A few man page fixes from RHEL-5

2008-02-04 Thread Matthew Woehlke
Tomas Janousek wrote: these three patches have been accepted into RHEL-5.2 and I think they may be worth including in bash upstream. +Also, please note that while executing in non-interactive mode and while in +.I posix +mode, any special builtin (like \fB.\fP, \fB:\fP, \fBbreak\fP, +\fBcontinue

Re: Please advise on programming tactics/strategy

2007-12-26 Thread Matthew Woehlke
cga2000 wrote: On Tue, Dec 18, 2007 at 09:57:44PM EST, Matthew Woehlke wrote: You might want to look at bash's command redirection instead. ? Sorry, the "correct" term (at least, what the manpage uses :-) ) is "process substitution". Conceptually, it's a bit

Re: Segmentation fault

2007-12-18 Thread Matthew Woehlke
(things I forgot to say the first time...) Matthew Woehlke wrote: Chet Ramey wrote: seba wrote: GNU bash, version 3.2.25(1)-release (i686-pc-linux-gnu) Copyright (C) 2005 Free Software Foundation, Inc. #!/bin/sh This is wrong. You're using features that are not in classic Bourne

Re: Segmentation fault

2007-12-18 Thread Matthew Woehlke
Chet Ramey wrote: seba wrote: GNU bash, version 3.2.25(1)-release (i686-pc-linux-gnu) Copyright (C) 2005 Free Software Foundation, Inc. #!/bin/sh fib() { n=$1 [ $n == 0 -o $n == 1 ] && return $n fib $(($n-1)) ret1=$? fib $(($n-2)) ret2=$? return

Re: Please advise on programming tactics/strategy

2007-12-18 Thread Matthew Woehlke
cga2000 wrote: I was wondering if there is any way I can convince netstat to return its output to bash variables for processing. Pretty simple logic: Do forever: Call netstat to obtain RX & TX byte counts Print delta {current .. minus previous .. byte counts} Save current byte counts

Re: RFE? |> ?

2007-12-17 Thread Matthew Woehlke
Linda Walsh wrote: I was wondering about a possible RFE and whether or not it is "inadvisable" or not. I'd be surprised if no one had thought of it -- so maybe there is a problem in doing it. Just like: &>word#(preferred syntax) and >&word are semantically equivalent to ">w

Re: error with ' in command substitution

2007-10-30 Thread Matthew Woehlke
Scott Moser wrote: Description: #= test.sh = x=$(cat <<"EOF" bad' syntax EOF ) #=== end test.sh === [snip] So, I'm not 100% certain what the "correct" behavior is, but it certainly seems like this should work. Given that: cat << EOF bad' syntax EOF ...is correct syntax, IMO the same

Re: Evaluating a variable within a variable

2007-10-23 Thread Matthew Woehlke
Paul Jarc wrote: TimtheEagle <[EMAIL PROTECTED]> wrote: main_auth=7 f=main t=auth ile=$f"_"$t echo $ile Either: echo "${!ile}" Not portable. Or: eval "echo \"\$$ile\"" Portable (even to Solaris /bin/sh which is not POSIX). Not saying which you should use, just something to be awa

Re: Offset error (when using PS1 with colors and newline)

2007-10-03 Thread Matthew Woehlke
dAniel hAhler wrote: Can you reproduce the bug with PS1="\n\[\033[0m\]" (which seems to be valid as far as I can see)? Yes... I was able to reproduce on bash 3.2.9, but not bash 3.0.15 or bash 3.2.5. Good chance that makes one of four patches the culprit :-). -- Matthew "Passion is inversely

Re: Function visibility

2007-10-02 Thread Matthew Woehlke
Stephane Chazelas wrote: Note that #! /bin/sh will not always give you a POSIX shell. Sometimes, it may give you an ancient shell that your Unix vendor keeps there for backward compatibility. THANK YOU! It's nice to know I'm not the only one laboring under wrong the notion that /bin/sh is alwa

Re: Offset error (when using PS1 with colors and newline)

2007-10-02 Thread Matthew Woehlke
dAniel hAhler wrote: On 2007-07-12 Andreas Schwab wrote: 1. Set PS1="\033[01;37m[ \[\033[01;34m\]\w\[\033[00m\] \033[01;37m]\n\$\033[00m " You need to bracket _every_ nonprinting sequence of characters with \[\]. I've asked you before, but you've not answered, or it got lost. What n

Re: bash should retry a fork() returning EAGAIN

2007-09-18 Thread Matthew Woehlke
Martin Koeppe wrote: I'm using bash 3.1 on interix. There fork() may fail with EAGAIN if e.g. several builds (configures) are running in parallel. Unfortunately, fork() isn't retried and configure stops. So I suggest adding this patch to bash which retries fork() when it fails with EAGAIN. I

Re: Newbie question

2007-09-13 Thread Matthew Woehlke
chitti wrote: Can anyone tell me how to find identify all suid and sgid programs, display their name, permission, time stapms and size, et. al in format similar to the output of shell command "ls" in the following directory /usr/bin and /usr/ucb many thanks You're on the wrong forum, as this qu

Re: double click filenames with spaces

2007-08-15 Thread Matthew Woehlke
maryatthelake wrote: I am using voice recognition software (Dragon Naturally Speaking) with the bash shell. I have a command that double clicks on a filename then copies it and does a cd to it on the command line. Of course, the command doesn't work when there is a space in the filename (Wind

Re: file name completion

2007-07-23 Thread Matthew Woehlke
Bruce Korb wrote: I do not know if this is an obsolete feature or not, Not as far as I can tell. but using GNU bash, version 2.05b.0(1)-release I can press TAB and get file name completion on arguments like ``*abc'' when there is only one file ending in ``abc''. With my version at home GNU b

Re: Subnet address

2007-07-23 Thread Matthew Woehlke
Mike Frysinger wrote: On Saturday 21 July 2007, Archimerged Ark Submedes decided to be rude: On 7/20/07, Mike Frysinger <[EMAIL PROTECTED]> did not read the question. The answer is: funny, you just backed up my statement completely. there is no utility that'll give you the subnet address st

Re: Exit-on-error option does not work as expected

2007-07-17 Thread Matthew Woehlke
[EMAIL PROTECTED] wrote: Script: #! /bin/bash set -e archive_item() { set -e false # this is the command that fails to archive the item echo 'Archived.' } delete_item() { true

Re: bash: no job control in this shell

2007-06-28 Thread Matthew Woehlke
Bob Proulx wrote: JimK wrote: Which initially I didn't think really mattered, but I just found out that man/less/more do not work after displaying their initial screen. Commands like "q" are not processed like they should so you are stuck inside of man/less/more. You would probably need "q\n"

Re: wrong logical evaluation of expressions involving true or false commands

2007-06-26 Thread Matthew Woehlke
Paul Jarc wrote: Matthew Woehlke <[EMAIL PROTECTED]> wrote: Stephane Chazelas wrote: [ -n "$foo" -a -n "$bar" ] is not the expression to test whether both "$foo" and "$bar" are non-empty, as it would fail for some specific values of $foo or $b

Re: wrong logical evaluation of expressions involving true or false commands

2007-06-25 Thread Matthew Woehlke
Stephane Chazelas wrote: And it should be noted (and it's noted as well in the page you're refering to) that while the above is true for strings such as "foo" and "bar", it is not true in the general case. [ -n "$foo" -a -n "$bar" ] is not the expression to test whether both "$foo" and "$bar" a

Re: How to remove a specific line in a file

2007-05-01 Thread Matthew Woehlke
Eka1618 wrote: I am currently trying to figure out how to remove a specific line in a file. So far I've only been able to come up with Ideas such as removing blank lines, duplicate lines, or a number of line that are one right after another. I think that I should be using the commands grep, cat,

Re: how does bash parse back-ticks, anyway?

2007-04-03 Thread Matthew Woehlke
Eric Blake wrote: According to Matthew Woehlke on 4/2/2007 5:09 PM: If nothing else, I'll stand by it being a bash bug, if only in the docs because they are not sufficiently clear. :-) The POSIX rules here are [snip] Ok, but the man page is still unclear. :-) (Sigh. Curse Solari

Re: [Bug 103756] kate: syntax highlighting error: bash and escaped quotes

2007-04-02 Thread Matthew Woehlke
Eric Blake-1 wrote: Current bash.xml accepts (a), but not (b). The single qoute is the start of string highlight. It's also not just the backtick block, but the backtick block inside of a double quote string block - and vice versa. First, be aware that `` in bash 3.1 was buggy, so you should up

Re: how does bash parse back-ticks, anyway? (was: [Bug 103756] kate: syntax highlighting error: bash and escaped quotes)

2007-04-02 Thread Matthew Woehlke
Since this is not really appropriate to the bug report, I am moving it exclusively to the lists. Please direct replies to kwrite-develkde.org and bug-bashgnu.org. Carsten Lohrke wrote: Matthew Woehlke wrote: Carsten Lohrke wrote: Current bash.xml accepts (a), but not (b). The single qoute

Re: [Bug 103756] kate: syntax highlighting error: bash and escaped quotes

2007-04-02 Thread Matthew Woehlke
Carsten Lohrke wrote: Current bash.xml accepts (a), but not (b). The single qoute is the start of string highlight. It's also not just the backtick block, but the backtick block inside of a double quote string block - and vice versa. x="`echo \"'\\\"\"`"is valid My bash highlighter thinks

Re: source(builtin) and read(2)

2007-03-23 Thread Matthew Woehlke
Eric Blake wrote: According to Matthew Woehlke on 3/23/2007 2:40 PM: SSIZE_MAX is guaranteed to be the maximum value that fits in ssize_t. ...that "fits", or that "may be stored in"? Again, if your ssize_t is smaller than 32 bits, your platform has other issues. Just

Re: source(builtin) and read(2)

2007-03-23 Thread Matthew Woehlke
Eric Blake wrote: According to Matthew Woehlke on 3/23/2007 1:38 PM: Huh? I never said anything about ssize_t, I said SSIZE_MAX which appears to be guaranteed by POSIX to be at least 32 *kilobytes*, SSIZE_MAX is guaranteed to be the maximum value that fits in ssize_t. Again, if your ssize_t

Re: source(builtin) and read(2)

2007-03-23 Thread Matthew Woehlke
Andreas Schwab wrote: Matthew Woehlke writes: Um. In fact, it is also an *ERROR* (i.e. read() will fail outright with - IIRC - EINVAL) to try to read more than SSIZE_MAX bytes at once. Many, but not all, systems define SSIZE_MAX to be a very large value, but it may be as small as 32k. I guess

Re: source(builtin) and read(2)

2007-03-23 Thread Matthew Woehlke
[EMAIL PROTECTED] wrote: The source builtin command reads the given file after getting its size by fstat(2). But bash doen't check the read bytes which is a return value of read(2). builtins/evalfile.c _evalfile() { fd = open (filename, O_RDONLY); fstat (fd, &finfo); file_size = (size_t)fi

Re: signal propogation to backgrounded subshells

2007-03-06 Thread Matthew Woehlke
Jeff Weber wrote: (/bin/kill is required. The bash builtin kill cannot kill an entire process group.) Well, assuming you know that /bin/kill is what you want. In my case I know I would want to use 'env kill ' instead. (Does bash really not have any other way to suppress built-ins?) -- Matt

Re: GNU bash, 3.00.15(1)-release, referenced cmd in cwd executes alternate cmd

2007-03-02 Thread Matthew Woehlke
Bob Proulx wrote: Matthew Woehlke wrote: Apparently selectively shadowing libc is non-trivial... any suggestions/hints? Not so much non-trivial as perhaps non-obvious. The dynamic loader is part of libc and so by the time the program tries to use LD_LIBRARY_PATH it is already too late

Re: GNU bash, 3.00.15(1)-release, referenced cmd in cwd executes alternate cmd

2007-02-28 Thread Matthew Woehlke
Bob Proulx wrote: Matthew Woehlke wrote: Бојан Ландекић wrote: Is it possible to put bash on some portable media and use it on a system that is bash-less without worrying about dependencies? Not unless you build it statically, it isn't. :-) Although I think if you build ba

Re: Bash getopts option

2007-02-28 Thread Matthew Woehlke
Shanks wrote: I am trying to parse command line options using getopts. for parsing options that are words , for e.g -help, Bash is not allowing me to do that. while getopts c:d:fh:help options do case $options in help) echo" Help" ;; done The above code does not parse

Re: GNU bash, 3.00.15(1)-release, referenced cmd in cwd executes alternate cmd

2007-02-27 Thread Matthew Woehlke
Бојан Ландекић wrote: On 27-Feb-07, at 2:26 PM, Matthew Woehlke wrote: IIRC we were talking about why e.g. 'ls' would not run 'which ls', right? In that case "correct" could be said to mean that 'which ' ("which" is assumed to execute in a ne

Re: man page "-c" explanation clarity

2007-01-23 Thread Matthew Woehlke
Paul A. Clarke wrote: The man page states, for the "-c" option: -c string If the -c option is present, then commands are read from string. If there are arguments after the string, they are assigned to the positional parameters, starting with $0. I th

Re: nocaseglob

2007-01-23 Thread Matthew Woehlke
Bruce Korb wrote: Chet Ramey wrote: This shows the collating sequence for alphabetics in the en_US locale. (Since I don't set LC_ALL anywhere in my startup files, my system's default locale is apparently en_US.UTF-8.) Is _that_ the deal, then? There is such a thing as a "system default loca

Re: Open file descriptors

2007-01-18 Thread Matthew Woehlke
Richard Ray wrote: Other than lsof is there a way to determine what file descriptors are open? I very much doubt there is a portable way, if that's what you're asking... On Linux there is also /proc/fd, I think? -- Matthew "What a wonderful smell you've discovered!" -- Princess Leia Organa

Re: BASH Frequently-Asked Questions (FAQ version 3.35)

2007-01-15 Thread Matthew Woehlke
Chet Ramey wrote: This is the Bash FAQ, version 3.35, for Bash version 3.2. [snip FAQ] Shouldn't D1 say something about many (most?) Linux distros that have GNU 'which'? This is of course different from scripts calling into csh and perl scripts. Saying '... is a perl script or C program ...

Re: GNU bash, 3.00.15(1)-release, referenced cmd in cwd executes alternate cmd

2007-01-04 Thread Matthew Woehlke
Bojan Land wrote: If I just use 'type mycmd' the result is similar in that it simply prepends the query before the result with " is " inbetween; -p prevents this additional processing and output? No. According to 'help type', "If the -p flag is used, `type' either returns the name of the disk

Re: GNU bash, 3.00.15(1)-release, referenced cmd in cwd executes alternate cmd

2007-01-04 Thread Matthew Woehlke
Bob Proulx wrote: Matthew Woehlke wrote: $ which --version GNU which v2.16, Copyright (C) 1999 - 2003 Carlo Wood. Wonderful. Yet another 'which' implementation! But a consistent (when available) one. :-) I like GNU programs because they are usually portable; for example I have

Re: GNU bash, 3.00.15(1)-release, referenced cmd in cwd executes alternate cmd

2007-01-04 Thread Matthew Woehlke
Bob Proulx wrote: Bojan Land wrote: Do you know which shells do not have type and thus rely on which? I wouldn't guess that *any* shell "relies" on 'which'... probably all shells have built-in $PATH lookup, but may not expose it to the user in the way bash's 'type' does. As far as I know

Re: GNU bash, 3.00.15(1)-release, referenced cmd in cwd executes alternate cmd

2007-01-04 Thread Matthew Woehlke
Bojan Land wrote: Under what circumstances does the gnu-bash path hash differ from that of the $PATH variable? Why is it even possible for this difference to occur? Because bash uses a hash to speed look-up of frequently used commands. The only way to (almost) always get the right command eve

Re: Bash - various feature requests

2007-01-03 Thread Matthew Woehlke
Richard Neill wrote: 1)substr support for a negative length argument. For example, stringZ=abcdef echo ${stringZ:2:-1} #prints cde i.e. ${string:x:y} returns the string, from start position x for y characters. but, if x is negative, start from the right hand side and if y is negative,

Re: Hidden files feature request

2006-11-27 Thread Matthew Woehlke
Uno Engborg wrote: In Gnome, MacOS-X, and in Kubuntu KDE, you can make a file hidden from the desktop environment by listing it in a file called .hidden. The .hidden file resides in the same directory as the files to be hidden, and lists the files to be hidden as one file/line. Files hidden by b

Re: Expansion of ${!x*} and [EMAIL PROTECTED]

2006-11-07 Thread Matthew Woehlke
Linda Walsh wrote: The manpages for "my" bash's (3.1.11 on Linux and 3.1.17 on cygwin/i686), under Parameter Expansion, say: ${!prefix*} [EMAIL PROTECTED] Expands to the names of variables whose names begin with prefix, separated by the first character of the IFS special v

Re: bash-3.x problems on IRIX

2006-10-27 Thread Matthew Woehlke
Matthew Woehlke wrote: Stuart Shelton wrote: The following problems exist, at the very least, in bash 3.1.16, 3.1.17, and 3.2.1 - I assume it affects the all bash-3.x releases. The hang is a different issue that seems to affect bash when built with compilers other than gcc; I can reproduce

Re: bash-3.x problems on IRIX

2006-10-26 Thread Matthew Woehlke
Stuart Shelton wrote: The following problems exist, at the very least, in bash 3.1.16, 3.1.17, and 3.2.1 - I assume it affects the all bash-3.x releases. If bash is built with the SGI MIPSpro compilers then, now matter what other CFLAGS are in affect, the test suite fails in many ways (and one

Re: need explanation ulimit -c for limiting core dumps

2006-10-20 Thread Matthew Woehlke
Chet Ramey wrote: [EMAIL PROTECTED] wrote: I'm trying to limit the size of coredumps using 'ulimit -c'. Can someone please explain why a core file gets generated from the coretest program (source is below)? Thanks for any help or suggestions. % ulimit -H -c 512 % ./coretest 2048 rlim_cur,rl

Can 'read' be used with tab-completion?

2006-10-20 Thread Matthew Woehlke
I've been wondering this for a long time, but can't figure anything out from the doc... Is it possible to specify a list of possible completions for the 'read' built-in? -- Matthew "Try to bring it back in one piece this time." -- Q (MI6) ___ Bug-b

Re: logout from interactive subshell

2006-10-12 Thread Matthew Woehlke
Com MN PG P E B Consultant 3 wrote: Does someone know how to deal with the following situation? Very often I do the following pattern: (1) rlogin to a foreign host (2) Invoke a subshell (for example because I'm setting a Clearcase View) (3) Logout from the host Step (3) needs two step