Question about variables and for loop

2006-03-18 Thread Bob
echo $x done That does not work as desired, nor does putting "$XXX" within quotes do the trick (obviously). Is there a way? Bob ___ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash

Re: Question about variables and for loop

2006-03-18 Thread Bob
On Sat, 18 Mar 2006 20:44:17 -0500, Paul Jarc wrote: > Bob <[EMAIL PROTECTED]> wrote: >> XXX='a "b c" d' >> for x in $XXX ; do >> echo $x >> done > > XXX='a "b c" d' > eval "set $

Re: Question about variables and for loop

2006-03-18 Thread Bob
On Sun, 19 Mar 2006 03:02:51 +, Bob wrote: > On Sat, 18 Mar 2006 20:44:17 -0500, Paul Jarc wrote: > >> Bob <[EMAIL PROTECTED]> wrote: >>> XXX='a "b c" d' >>> for x in $XXX ; do >>> echo $x >>>

Re: bug with edit-and-execute-command and multiline commands

2021-08-06 Thread Bob Proulx
o yes; else echo no; fi ed> q if true; then echo yes; else echo no; fi yes > C-d bash: syntax error: unexpected end of file exit Just another rendition of the same thing. Bob

Re: [OT] Linux Out-Of-Memory Killer

2010-11-03 Thread Bob Proulx
n some detail here: http://lists.debian.org/debian-user/2007/08/msg00022.html And more recently with a little more rationale here: http://lists.debian.org/debian-user/2008/04/msg02554.html Bob

Re: Trouble with PS1 special characters between \[ and \]

2010-11-05 Thread Bob Proulx
PROMPT_COMMAND='echo -ne "\033]0;${us...@${hostname}:${PWD/$HOME/~}\007"' ;; esac Then add something like this for your adjusted PS1 prompt. PS1='\n\[\033[1;31m\]...@\h:\w]\$\[\033[0m\] ' That leading \n gives me pause though... Bob

Re: ionice bash pid in bash_profile Fails

2010-11-22 Thread Bob Proulx
Roger wrote: > # See ionice manfile - give high priority to Bash > ionice -c 2 -n 0 -p `echo $$` You don't need to use backticks to echo out the value of $$. Just use it directly. ionice -c 2 -n 0 -p $$ Bob

Re: Clear Screen

2010-12-01 Thread Bob Proulx
o clear characters but not to clear the characters from the previous command. That information does not exist. Adding a way to track that information is not easy and would introduce many problems and errors. Therefore what you are asking for probably is unlikely to ever be implemented. Bob

Re: Clear Screen

2010-12-01 Thread Bob Proulx
ion currently attached to C-l. Then it would work as you describe. I have never done that, don't know how, but it seems reasonable to me. :-) Bob

Re: Recursively calling a bash script goes undetected and eats all system memory

2010-12-09 Thread Bob Proulx
ly not a simple thing to do at all. This is really a much harder problem than you think it is and isn't something that can be fixed in bash. The best result is simply learning to avoid the problem. Bob

Re: cd with multiple arguments?

2010-12-15 Thread Bob Proulx
people would consider at least one of those in that set a real programming language. :-) Bob

Re: cd with multiple arguments?

2010-12-16 Thread Bob Proulx
Marc Herbert wrote: > Bob Proulx a écrit : > > The shell isn't the only one that introduces a security vulnerability > > on most systems when setuid. All interpreters are the same in that > > regard. On systems where you shouldn't suid scripts then you > >

Re: cd with multiple arguments?

2010-12-17 Thread Bob Proulx
ed. That is why there have been so many successful attacks in the past. There isn't any magic sauce to make all of the complication go away. Attackers are as clever as you. It is a classic battle between armorer and weapons maker. Bob There are two types of complicated programs. Those that w

Re: Bug in shell: buffer overflow.

2010-12-31 Thread Bob Proulx
"72057594037927936*128" | bc -l) 9223372036854775808 Bob

Re: Bug in shell: buffer overflow.

2011-01-01 Thread Bob Proulx
Stephane CHAZELAS wrote: > Bob Proulx wrote: > [...] > > Your expressions above are overflowing the value of your system's > > maximum integer size. You can read the system's maximum integer size > > using getconf. > > > > $ getconf INT_MAX >

Re: client server date sync

2011-01-12 Thread Bob Proulx
eserverhost date -R)" Push: date -R | ssh remoteclienthost date --date='"$(cat)"' The --date= just prints the time. After you are happy with the results change --date= to --set= which actually sets the system clock. I think it would be much more productive use of your resources to enable ntp instead. Bob

Re: Arithmetic expansion peculiarity

2011-01-14 Thread Bob Proulx
ote octal. In octal the valid digits are 0-7 with 8 and 9 outside of the octal range. Bob

Re: multi-line commands in the history get split when bash is quit

2011-02-05 Thread Bob Proulx
nd a severe bug if it did. Are you forgetting to put your desired configuration into ~/.bashrc where it is loaded when bash starts? Are you forgetting to put source "$HOME/.bashrc" into your ~/.bash_profile where it will source your .bashrc when you log into your account? Bob

Re: [BUG] Bash not reacting to Ctrl-C

2011-02-08 Thread Bob Proulx
me you are running bash otherwise.) Is the behavior you observe any different for this case? $ bash -c 'while true; do /bin/true || exit 1; done' Or different for this case? $ bash -e -c 'while true; do /bin/true; done' Bob

Re: [BUG] Bash not reacting to Ctrl-C

2011-02-09 Thread Bob Proulx
Oleg Nesterov wrote: > Bob Proulx wrote: > > Is the behavior you observe any different for this case? > > $ bash -c 'while true; do /bin/true || exit 1; done' > > Or different for this case? > > $ bash -e -c 'while true; do /bin/true; done' >

Re: [BUG] Bash not reacting to Ctrl-C

2011-02-09 Thread Bob Proulx
bash -c 'while true; do /bin/true || exit 1; done' Bob

Re: [BUG] Bash not reacting to Ctrl-C

2011-02-09 Thread Bob Proulx
T}="DEFAULT";kill(INT,$$);}; sleep' || exit 1 echo "Hehe, I am going to sleep after ^C" sleep 100 exit(0); Does this get interrupted after one SIGINT now that it isn't being caught and ignored? To be clear I am simply trying to make sure the test cases are not themselves creating the problem. Bob

Re: Can someone explain this?

2011-02-11 Thread Bob Proulx
lls parse the command line. Quoting is then much simplified. Bob

Re: how to workaroun 'nl' being added to input-line after 49 characters....

2011-02-13 Thread Bob Proulx
nt something like: _CRed="$(echo -en "\033[31m")" #Red _CRST="$(echo -en "\033[0m")" #Reset _CBLD="$(echo -en "\033[1m")" #Bold export _prompt_open="" export _prompt_close=">" [[ $UID -eq 1000 ]] && { _prompt_open="$_CBLD$_CRed" _prompt_close="#$_CRST" } export PS1='\[${_prompt_open}\]$(pwd "$PWD")\[${_prompt_close}\] '; But I didn't test the above. Bob

Re: how to workaroun 'nl' being added to input-line after 49 characters....

2011-02-13 Thread Bob Proulx
ll of the discussion around the \[...\] has been about. Unless I have completely misunderstood your problem but I don't think so. Bob

Re: how to workaroun 'nl' being added to input-line after 49 characters....

2011-02-13 Thread Bob Proulx
tly using. _CRed=$(tput setaf 1) #Red _CRST=$(tput sgr0) #Reset _CBLD=$(tput bold) #Bold _prompt_open="" _prompt_close="" _prompt=">" [[ $UID -eq 0 ]] && { _prompt_open="$_CBLD$_CRed" _prompt_close="$_CRST" _prompt="#" } PS1='\[$_prompt_open\]$(pwd "$PWD")$_prompt\[$_prompt_close\] '; Bob

Re: how to workaroun 'nl' being added to input-line after 49 characters....

2011-02-14 Thread Bob Proulx
Greg Wooledge wrote: > red=$(tput setaf 1) bold=$(tput bold) reset=$(tput sgr0) > PS1='\[$red\]\h\[$reset\]:\[$bold\]\w\[$reset\]\$ ' > > I tested that. It works. Nicely cleaned up! > PS1='\h:\w\$ ' For what it is worth I use something similar: PS1='\u@\h:\w\$ ' Bob

Re: bash tab variable expansion question?

2011-02-25 Thread Bob Proulx
~-/. is no equal to $PWD No. But it is similar to $OLDPWD which is what Greg had written about. Bob

Re: Problem with open and rm

2011-03-16 Thread Bob Proulx
SPLAY" ] && open -W /tmp/$$.html ls /tmp/$$.html rm -f /tmp/$$.html I do not have a Mac and have no way to test the above but the documentation leads me to believe that it will work. Bob

Re: Bash

2011-04-27 Thread Bob Proulx
nd permissions this is the safer course of action. Bob

Re: a "script-relative" version of env

2011-05-27 Thread Bob Proulx
ttp://www.in-ulm.de/~mascheck/various/shebang/ Bob

Re: last argument expansion has different output using the sh interpreter

2011-05-27 Thread Bob Proulx
it needs bash explicitly or you could use portable only constructs and continue to use /bin/sh. Personally I use bash for my command line but /bin/sh and portable constructs for shell scripts. Bob

Re: Copy in bash

2011-06-07 Thread Bob Proulx
is a b c > > What would be script to acheive this functionality You will need to quote the filename to preserve the spaces. $ cp "a b c" /some/other/directory/ Bob

Re: Yet Another test option

2011-07-03 Thread Bob Proulx
enable_ext4='no' I seem to recall a similar command on Red Hat based systems but off the top of my head the details escape me. Bob

Re: Built-in printf Sits Awkwardly with UDP.

2011-07-19 Thread Bob Proulx
r do you know if the next character that has no yet been generated yet will be a newline? Should it wait a timeout until characters have stopped appearing? It really isn't a problem that can always be solved perfectly in every case. Bob

Re: How to do? Possible?

2011-07-25 Thread Bob Proulx
rocess, Yes, but it is a fork(2) of the parent shell and all of the variables from the parent are copied along with the fork into the child process and that includes non-exported variables. Normally you would expect that a subprocess wouldn't have access to parent shell variables unless they were exported. But with a subshell a copy of all variables are available. Bob

Re: How to do? Possible?

2011-07-25 Thread Bob Proulx
;} foo="bar" ( printfoovar ) #!/bin/sh printfoovar() { eval echo \$$foo ;} bar="hello" foo="bar" ( printfoovar ) Bob

Re: How to do? Possible?

2011-07-25 Thread Bob Proulx
and (...) is back to the original discussion of the thread that subshells have access to copies of all parent variables including variables that were not explicitly exported. Hope that helps to clarify things. Bob

Re: The mailing list software interfered with my content

2011-08-03 Thread Bob Proulx
ddresses are useless if not known and once known cannot be hidden. But just the same I have experienced that people complain vehemently if you don't mangle addresses in the web archive. And then problems such as the above occur. Sigh. It is impossible to please both sets of people. Bob

Re: bug: return doesn't accept negative numbers

2011-08-05 Thread Bob Proulx
ery=exit&apropos=0&sektion=3&manpath=2.9.1+BSD&format=html Now you might argue that -1 is always going to be all ones in two's complement. Sure. But traditionally it has always been unsigned. Bob

Re: bug: return doesn't accept negative numbers

2011-08-07 Thread Bob Proulx
Linda Walsh wrote: > How about portable code using: > > (exit -1); return > > It's ugly, but would seem to be the portable/official way to > do this. Exit codes should be in the range 0-255. Bob

Re: bug: return doesn't accept negative numbers

2011-08-07 Thread Bob Proulx
Linda Walsh wrote: > Bob Proulx wrote: > >Exit codes should be in the range 0-255. > --- > I suppose you don't realize that 'should' is a subjective opinion that > sometimes has little to do with objective reality. Sigh. Okay. Keep in mind that turn about

Re: equivalent of Linux readlink -f in pure bash?

2011-08-08 Thread Bob Proulx
7; Sure it doesn't handle whitespace in filenames but what classic AIX Unix symlink would have whitespace in it? :-) Bob

Re: equivalent of Linux readlink -f in pure bash?

2011-08-08 Thread Bob Proulx
uot;) physdir=$(cd "$dir"; pwd -P) realpath=$(cd "$dir"; ls -l "$base" | awk '{print$NF}') echo "$physdir/$realpath" | sed 's|//*|/|g' exit 0 Again, another very quick and partial solution. But perhaps something good enough just the same. Bob

Re: equivalent of Linux readlink -f in pure bash?

2011-08-08 Thread Bob Proulx
ally don't use a pattern expression. But I agree it is another way to go. But it is easier to say whitespace is bad in filenames than to say whitespace is bad and oh yes you can't have "->" in there either. :-) Bob

Re: equivalent of Linux readlink -f in pure bash?

2011-08-08 Thread Bob Proulx
cd $(dirname "$path"); pwd -P) base=$(basename "$path") > echo "${dir%/}/${base}" > fi > } And of course those are just suggestions and nothing more. Feel free to ignore. Note that there is a recent movement to change that dash greater-than combination into a true unicode arrow graphic emited by 'ls'. I think things paused when there were several different bike shed suggestions about which unicode arrow symbol people wanted there. I haven't seen any actual movement for a while and I think that is a good thing. Bob

Re: Coproc usage ... not understanding

2011-08-09 Thread Bob Proulx
/programming/stdio_buffering/ And the 'stdbuf' command the came out of it. http://www.gnu.org/software/coreutils/manual/html_node/stdbuf-invocation.html#stdbuf-invocation Bob

Re: Coproc usage ... not understanding

2011-08-10 Thread Bob Proulx
Greg Wooledge wrote: > Linda Walsh wrote: > > Bob Proulx wrote: > > >This may be a good point to mention this reference: > > > > > > http://www.pixelbeat.org/programming/stdio_buffering/ > > > Does it only work with gnu programs? I.e. how would

Re: Why bash command "cd //" set path "//" ?

2011-08-26 Thread Bob Proulx
in is making good use of it in the Cygwin environment for the same purpose. Therefore the standards say that two leading slashes are significant and are handled specially. It might be a network path. But three or more leading slashes are not significant and anywhere else in the path multiple slashes are not significant. Bob

Re: date command

2011-10-04 Thread Bob Proulx
T isdst=1 gmtoff=-21600 US/Mountain Sun Nov 7 07:59:59 2010 UTC = Sun Nov 7 01:59:59 2010 MDT isdst=1 gmtoff=-21600 US/Mountain Sun Nov 7 08:00:00 2010 UTC = Sun Nov 7 01:00:00 2010 MST isdst=0 gmtoff=-25200 See this FAQ entry for more information: http://www.gnu.org/software/coreutils/faq/#The-date-command-is-not-working-right_002e Bob

Re: Time delay on command not found

2011-10-10 Thread Bob Proulx
> How do I get rid of the delay. I want it to release the terminal > immediately. Does your PATH contain directories on NFS or other networked fileservers? If so then those are typical sources of delay. To easily see your directories in PATH: echo $PATH | tr : "\012" Bob

Re: problem with tail -f that need to add to each line constant string at the beginning of each line

2011-10-29 Thread Bob Proulx
ame): /"' ssh -n server2 'tail -f /var/log/syslog | sed --unbuffered "s/^/$(hostname): /"' You might consider applying the commands as standard input instead. I think it is easier to avoid quoting problems that way. echo 'tail -f /var/log/syslog | sed --unbuffered "s/^/$(hostname): /"' | ssh -T server1 Bob

Re: problem with tail -f that need to add to each line constant string at the beginning of each line

2011-10-30 Thread Bob Proulx
xpect a new question about how to start and restart this connection automatically. (Am I right? :-) Instead please investigate using one of the syslog programs that does exactly that already. See for example 'rsyslogd' which supports remote logging. Good luck! Bob

Re: script to provide responses to prompts (badly written C program)

2011-10-31 Thread Bob Proulx
h the development of the shell. I am going to send an answer to you but in another message. I will CC the help-gnu-utils mailing list. Let's move any discussion and followup to help-gnu-utils instead of here. Bob

Re: bash-completion between do and done

2011-11-04 Thread Bob Proulx
Peng Yu wrote: > Current, bash doesn't do command completion between do and done (for loop). > I'm wondering if this feature can be added. Of course bash does do command completion between do and done. Can you give an exact example test case? On what version of bash? Bob

Re: bash-completion between do and done

2011-11-05 Thread Bob Proulx
out of sync with the current action point. Of course I was trying filename completion. The simpler case is: while false; do l But other completions do work fine. while false; do ls --so while false; do ls ~/.ba As a workaround you can force command completion using 'C-x !' and 'M-!'. Bob

Re: exit status issue

2011-11-18 Thread Bob Proulx
y to /dev/console is a little harsh. You might consider using the 'logger' program and writing to the syslog instead. Your script makes me think that you might be using an NFS automounter and trying to correct nfs client problems. (shrug) Bob

Re: exit status issue

2011-11-18 Thread Bob Proulx
DJ Mills wrote: > Bob Proulx wrote: > > sh -x ./scripttodebug > > I'm guessing you mean bash -x, not sh -x. Two different shells. It is a bash list so I probably should have said bash just to be politically correct. But the script doesn't use any bash specific constr

Re: help-b...@gnu.org mailing list

2011-11-21 Thread Bob Proulx
..@gnu.org. And in a similar way I added the following description to help-bash. Bash is the GNU Project's Bourne Again SHell. This list is for asking questions about bash and shell programming. Also available is htlp-gnu-ut...@gnu.org for general questions about the shell utilities. Any comments? Bob

Re: help-b...@gnu.org mailing list

2011-11-22 Thread Bob Proulx
one is curious as to what text we have been talking about it is the text that shows up here, and related places: https://lists.gnu.org/mailman/listinfo/bug-bash Bob

Re: exit status issue

2011-11-22 Thread Bob Proulx
>> "$1"/.accesstest Or you could use a helper command. Using a different program other than 'touch' may cause it to emit a better error message. Bob

Re: exit status issue

2011-11-22 Thread Bob Proulx
d your troubles. But that isn't the scientific method. http://en.wikipedia.org/wiki/Scientific_method#Elements_of_scientific_method > Not doing anything with NFS mounting thankfully. It's a RAID array on > a NAS device which is typically used for SMB / CIFS network mount. Your system is mounting it using an SMB mount? Then perhaps your network protocol layer is causing trouble. I think a bug in the SMB layer is much more likely. Bob

Re: Severe memleak in sequence expressions?

2011-11-30 Thread Bob Proulx
the system either. If you want bash to be reduced to a smaller size try exec'ing itself in order to do this. $ exec bash That is my 2 cents worth plus a little more for free. :-) Bob

Re: help-b...@gnu.org mailing list

2011-12-12 Thread Bob Proulx
Timothy Madden wrote: > Is the 'htlp-gnu-ut...@gnu.org' list on the help-bash info page > meant to be 'help-gnu-ut...@gnu.org' (note 'help' instead of 'htlp' > in the list name) ? > Can the list info on the web be updated ? Thanks for reporting that error. Fixed now. Bob

Re: Ill positioned 'until' keyword

2011-12-14 Thread Bob Proulx
was a way to negate the expression without using a '!' which didn't exist in that shell. An 'if' could operate using the 'else' clause. But there wasn't any other way to do it in a while loop. The addition of '!' to the language was one of the best features. IMNHO. I use it all of the time now. Bob

Re: return values of bash scripts

2011-12-20 Thread Bob Proulx
'. They are similar. But then instead of using 'ps aux' BSD style try not printing the full path by using 'ps -e'. You are matching your own grep becuase it is in the argument list. Then this can be made smarter by simply matching it as a string instead of as a pattern. ps -e | awk '$NF=="crond"' ps -e | awk '$NF=="crond"{print$1}' Bob signature.asc Description: Digital signature

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

2011-12-22 Thread Bob Proulx
ng the parameters listed with a leading dollar sign. The individual single character is difficult to search for but the combination of "$@" and so forth for the others is a useful search string. I have often wanted the manual to include the "$@" combination instead of just the "@" name. Bob

Re: how to understand echo ${PATH#*:}

2011-12-25 Thread Bob Proulx
ies separated by colons "#*:" will match and therefore remove the first element of the PATH. $ foo=one:two:three $ echo ${foo#*:} two:three And using two pound signs "##" would match the loggest pattern and remove all up through the last one. $ echo ${foo##*:} three Bob

Re: minor bug in bash

2012-01-17 Thread Bob Proulx
uot; device such as a serial port or tty or other. Assuming I recall this correctly of course. Bob

Re: test if shell is interactive

2012-01-22 Thread Bob Proulx
tapczan wrote: > #!/bin/bash > echo $- > > Execution: > > # ./a.sh > hB > > There is no 'i' so the session is non-interactive? > It was invoked from interactive. > Am I missing something? Shell scripts are not interactive. So what you are seeing above is correct. Bob

Re: test if shell is interactive

2012-01-22 Thread Bob Proulx
tapczan wrote: > Bob Proulx wrote: > > Shell scripts are not interactive. So what you are seeing above is > > correct. > > So, is there any way to test if script (a.sh) was invoked from interactive > session (human) or not (e.g. from cron)? I usually check if the standa

Re: excess braces ignored: bug or feature ?

2012-02-17 Thread Bob Proulx
}}} Seems reasonable to me. In that context the bracket isn't special in any way and is just another character in the string. Just like this: $ echo Bob

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

2012-02-28 Thread Bob Proulx
e a syntax error in other > > shells. > > I was going for || exit "Doomsday" i,e. 666 = 999 = Apocalypse. Yes. But... As we all know exit codes are only eight bits and that limits you to 0-255 only! Anything else and you have "jumped the tracks" with implementations doing implementation defined things. Maybe one of them will invoke the game of rogue! :-) Bob

Re: Bash scripting and large files: input with the read builtin from a redirection gives unexpected result with files larger than 2GB.

2012-03-04 Thread Bob Proulx
the resulting config.log file. configure:4710: checking for special C compiler options needed for large files configure:4805: result: no configure:4811: checking for _FILE_OFFSET_BITS value needed for large files ... configure:4922: result: 64 ... ac_cv_sys_file_offset_bits=64 Bob

Re: using the variable name, GROUPS, in a read list

2012-03-07 Thread Bob Proulx
ve been trying to train myself out of that habit for the last few years. Now I always use lower case variable names. (For example tmpdir, which shouldn't collide.) So for this I would say the script should use lower case names instead of upper case names. Bob

Re: compgen is slow for large numbers of options

2012-03-14 Thread Bob Proulx
lly allocating all memory, is inefficient. Whereas using grep as a filter to reduce that memory to 89 bytes is of course more efficient. I wrote a response on a similar issue previously. Instead of posting it again let me post a pointer to the previous message. http://lists.gnu.org/archive/html/bug-bash/2011-11/msg00189.html Bob

Re: Possible bug: Race condition when calling external commands during trap handling

2012-05-03 Thread Bob Proulx
And lastly I will comment that you are doing quite a bit inside of an interrupt routine. Typically in a C program it is not safe to perform any operation that may call malloc() within an interupt service routine since malloc isn't reentrant. Bash is a C program and I assume the same restriction would apply. Bob

Re: cd // produces unexpected results

2012-06-23 Thread Bob Proulx
within the standard. Any previously standard conforming and well behaved script would still be standard conforming and well behaved. That being the whole point of the POSIX standard I see this as a good thing. Bob

Re: square bracket vs. curly brace character ranges

2012-09-14 Thread Bob Proulx
ppen. But if libc isn't going to do it then it is beneficial if projects do it themselves outside of libc. Eventually in the future when libc addresses the problem then those hacks can be removed. Bob

Re: square bracket vs. curly brace character ranges

2012-09-15 Thread Bob Proulx
etail and pointed a reference. I am very happy to see things progress in that direction. Thanks! Bob

Re: a recursion bug

2012-10-02 Thread Bob Proulx
ally limited by the system policy. Bash here in this context is simply running within the operating system limits imposed by the policy of the system as reflected in the stack size limits. Bob

Re: a recursion bug

2012-10-02 Thread Bob Proulx
Unless you are set up to debug the resulting core then it isn't useful. Also dumping a large core over the network to an NFS mounted directory, an action that takes place in the kernel and on at least some systems is not interruptable, a few times will convince you that you don't want to wait for it. Bob

Re: square bracket vs. curly brace character ranges

2012-10-02 Thread Bob Proulx
hen you would. You might argue that the error message in that case could be more friendly. That would be a bash specific discussion and perhaps even a useful one. See 'man 3 setlocale' for more details. On my system locale files are stored down /usr/share/locale/* paths. Bob

Re: a recursion bug

2012-10-03 Thread Bob Proulx
n, most people would consider that bad. This is a reductio ad absurdum ("reduction to absurdity") argument that doesn't apply here. The linux kernel was not crashing. This is off the topic. Bob

Re: a recursion bug

2012-10-03 Thread Bob Proulx
ssage? Or are you suggesting that bash should specify its own stack area so as to avoid the system stack size limitation? I could see either of those first two solutions being reasonable. Bob

Re: a recursion bug

2012-10-03 Thread Bob Proulx
ch stack space as you can. Well... There is the gnulib c-stack module: http://www.gnu.org/software/gnulib/MODULES.html c-stack Stack overflow handling, causing program exit. Bob

Re: Clarification needed on signal spec EXIT

2012-10-16 Thread Bob Proulx
> Sending TERM signal to the subshell doesn't make "submain_cleanup()" > to be called. And it does in ksh93. Hmm... And it does if I comment out the line "trap main_cleanup EXIT". It seems to only set the trap if no trap handler was previously set. Bob

Re: documentation bug (uid resetting in posix mode)

2012-10-30 Thread Bob Proulx
value is sticky and will persist through upgrades until changed. Bob

Re: documentation bug (uid resetting in posix mode)

2012-10-30 Thread Bob Proulx
Stefano Lattarini wrote: > Hi Bob, thanks for the tips. However ... > > Bob Proulx wrote: > > Stefano Lattarini wrote: > >> Anyway, my /bin/sh is bash ... > >> $ ls -l /bin/sh > >> lrwxrwxrwx 1 root root 4 Jul 8 2010 /bin/sh -> bash > >>

Re: documentation bug (uid resetting in posix mode)

2012-10-30 Thread Bob Proulx
called as /bin/sh Debian patched it to not drop privileges? Or: 3. ?? Bob

Re: Any chance of multi-dimensional arrays?

2012-11-25 Thread Bob Proulx
ays then the only option for you is to simulate them. That isn't too difficult and if you search the web there are many different implementations with the biggest difference being whether ordering matters or not. Bob

Re: Cron jobs, env vars, and group ID ... oh my

2012-11-28 Thread Bob Proulx
y file. newgrp group1 < other-script-file Or you might consider using 'sudo' or 'su' for that purpose too. Bob

Re: Question about the return value of 'local'

2012-12-13 Thread Bob Proulx
option causes the export property to be removed from each name. If a variable name is followed by =word, the value of the variable is set to word. export returns an exit status of 0 unless an invalid option is encountered, one of the names is not a valid shell variable name, or -f is supplied with a name that is not a function. Bob

Re: |& in bash?

2013-01-22 Thread Bob Proulx
age here] operator precedence table. (If you looked over at your copy next to you then you know what I am talking about.) Bob

Re: |& in bash?

2013-01-22 Thread Bob Proulx
been absorbed yet. Just like: grep -r PATTERN Has replaced: find . -type f -exec grep PATTERN {} + And therefore they don't know how to write other directory traversal tasks either. find . -type f -exec sed -n '/PATTERN/s/THIS/THAT/gp' {} + Bob

Re: When cd'd into a symlinked directory, directory completion can sometimes erroneously parse ../

2013-02-06 Thread Bob Proulx
7;set -o physical' everywhere to have consistent behavior. The evil truth is better than a good lie. Bob

Re: Shouldn't this script terminate on ^C?

2013-02-19 Thread Bob Proulx
p://www.cons.org/cracauer/sigint.html Since this is being asked as a general question this would be a better topic to start discussing first on on the help-bash mailing list. As currently stated it is too non-specific to be a bug report to bug-bash. Bob

Re: export in posix mode

2013-02-27 Thread Bob Proulx
hell was constructed specifically to be as strictly conforming to posix as possible. (Making it somewhat less than useful in Real Life but it may be what you are looking for.) It is Debian specific in origin but should work on other systems. http://packages.debian.org/sid/posh http://anonscm.debian.org/gitweb/?p=users/clint/posh.git;a=summary Bob

Re: export in posix mode

2013-02-27 Thread Bob Proulx
$ cat >/tmp/trial <<'EOF' #!/bin/posh echo "Hello from posh" exit 1 EOF $ chmod a+x /tmp/trial $ /tmp/trial Hello from posh $ echo $? 1 I see no error when using 'exit 1'. Other than the expected exit code. What am I missing? Bob

Re: export in posix mode

2013-02-27 Thread Bob Proulx
#!/bin/bash as the interpreter. Scripts that specify #!/bin/sh and use bash specific features will fail. As a local option the local admin may change the /bin/sh symlink from dash to bash and run scripts from other systems that include bash features. But that isn't by default. However it is a useful option for people stuck needing to run code that isn't cleanly written. Bob

  1   2   3   4   5   6   >