Re: doing simple math in bash :: prb with leading zero

2009-09-01 Thread Linda Walsh
ken wrote: Doing very simple math in bash fails if a number begins with a zero (0). The short script below illustrates the problem: --- Normally, a leading 0 begins an octal constant (I have been bitten by this in the past as well...). Where are you getting the value 'lastmo' from? If from

Re: manpage note? weird strings that appear to be equal but create haywire comparisons?

2009-08-26 Thread Linda Walsh
Greg Wooledge wrote: On Wed, Aug 26, 2009 at 02:45:39AM -0700, Linda Walsh wrote: I had a var 'c' set to (no quotes in the var): 'C\windows\system32' How did you assign this value? Did you read it from a file? Did you type a specific bash command? -- I typed it in at the prompt

'time' redirection, and pipe redirections in general

2009-07-24 Thread Linda Walsh
Dave B wrote: On Friday 17 July 2009, Linda Walsh wrote: (majorly abbreviated) where output 'time' cmd go? I.e. Howto pipe_ 'time' output to _prog_ [?] smallor filesmall? Please see http://mywiki.wooledge.org/BashFAQ/032 An excellent and thorough webpage, but it doesn't exactly

regarding 'time' builtin

2009-07-17 Thread Linda Walsh
where does the output from the 'time' command go I.e. if I wanted to pipe the output to a prog or file, how would I go about doing it?

Re: ulimit -p incorrect on linux (and besides being low, probably unenforceable(?))

2009-07-06 Thread Linda Walsh
Chet Ramey wrote: Linda Walsh wrote: When under linux (2.6.30.x), I type ulimit -p and get a return value of 8. from the man page this is in 512-byte blocks and may not be set. It's set at build time. Look at builtins/ulimit.def:pipesize() and builtins/psize.sh (which uses builtins/psize.c

ulimit -p incorrect on linux (and besides being low, probably unenforceable(?))

2009-07-04 Thread Linda Walsh
When under linux (2.6.30.x), I type ulimit -p and get a return value of 8. from the man page this is in 512-byte blocks and may not be set. But if I look into the linux man page: man 7 pipe, under pipe capacity, I see: In Linux versions before 2.6.11, the capacity of a pipe was the same as

bgnice?

2009-06-28 Thread Linda Walsh
I thought I remembered a 'bgnice' value under the 'set' or shopt options It doesn't seem to be in my current bash. Was that only a ksh-ism? Maybe a feature add for bash? (also, adding a ENV var to alter the the bg-process prio mod would be a cool addition...but no biggy either way --

Re: simple bug/compat question

2009-01-21 Thread Linda Walsh
It's not a bug. --- It's a feature... ;-) test/[ uses -a and -o for `and' and `or'; the conditional command uses and || for that purpose. This is they way it's documented. --- Would it be inappropriate if [[ were to treat -a -o identically to -a || so [[ could be more of a

simple bug/compat question

2009-01-19 Thread Linda Walsh
Am running an older bash version and this may be fixed (assuming it is a bug and I'm not confused...:-)) bash version = 3.2.39(20) This works: 1) if [ -n -a 2 -gt 1 ] ; then echo one;fi This does not: 2) if [[ -n -a 2 -gt 1 ]] ; then echo one;fi Shouldn't 2 work equally well

shorthand attempt at 'basename file .ext'

2008-03-25 Thread Linda Walsh
hey folks, have what is maybe, mostly a mental exercise, but... forgive me if this is obvious, but seems I tried this before and didn't see 'obvious' way to make this work. could be viewed as a 'bug' (in terms of consistency' maybe?), but, I'd understand that the design may have been limited to

Re: errexit does not exit script in subshells

2008-02-01 Thread Linda Walsh
Michael Potter wrote: Bash Bunch, Not surprisingly, bash does not exit the script when an error is detected in a subshell. I am hopeful that someone has a solution to this (other than: be careful to not use subshells). This seems to work unless I'm missing something... #!/bin/bash

Re: Exit application with two function calls

2008-01-29 Thread Linda Walsh
Paul Jarc wrote: Linda Walsh [EMAIL PROTECTED] wrote: # *1 - using -e stops your script immediately on any error Not any error - only those from simple commands. The subtleties are subtle enough that I avoid -e, and use between all commands instead. paul Yeah...it doesn't catch

Re: Is there a Windows native port of Bash or Bourne Shell(no cygwin)?

2008-01-29 Thread Linda Walsh
Chen(é) Jun(å) wrote: sh -c pwd It outputs: /bin Oouups, what I expect was E:/msys/1.0/bin . Suprised? You now know what the weird sh.exe does. It checks whether some token starts with / , if so, it considers that toke a path and applies trasformation. This is utterly rude. So this sh.exe

matching !(patterns)

2008-01-29 Thread Linda Walsh
Paul Jarc wrote: It looks for substrings in both cases - specifically, the longest matching substring, which might happen to be the entire string. With !(), that is often the case. x=12ab34; echo ${x//+([0-9])/X}# prints XabX x=12ab34; echo ${x//!(+([0-9]))/X} # prints X

Re: -e does not work with subscript

2008-01-29 Thread Linda Walsh
Stepan Koltsov wrote: BTW, my use case for (false) is: === set -e ( cd some-dir make ) ( cd other-dir ./build.sh ) ( cd third-dir ant ) === Most readers (and writers) expect script to fail if make failed. So I think that outer bash should exit with error on (false) :-) I

Re: capturing sub-expressions?

2008-01-29 Thread Linda Walsh
Paul Jarc wrote: Linda Walsh [EMAIL PROTECTED] wrote: In my copy of the man pages, Pattern matching is indented an extra level making it look like it's under Pathname Expansion and only applies there Pattern matching applies primarily to pathname expansion; other uses explicitly refer

Re: capturing sub-expressions?

2008-01-29 Thread Linda Walsh
Paul Jarc wrote: Linda Walsh [EMAIL PROTECTED] wrote: p=-e -p 60 -x --- That's why I wanted the capture -- to pick out the 60 -- where 60 represents a positive integer. The space between the -p and the number is optional. It sounds like you're looking for getopt. --- I knew about

Re: Exit application with two function calls

2008-01-28 Thread Linda Walsh
Error invalid directory: \$1\ return $? fi --- Andreas Schwab wrote: Linda Walsh [EMAIL PROTECTED] writes: Check_file () { if [[ -d $1 ]]; then echo $1 # *4 else return Error invalid directory: \$1\; fi return expects a number, not the string

RFE? | ?

2007-12-10 Thread Linda Walsh
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 word 21 Has it been thought

/etc/bash.bashrc derivation and misuses

2007-02-24 Thread Linda Walsh
Chet Ramey wrote: not a standard part of the build, so it's not in the man page. Putting a mention of it in would cause more problems that it would solve. --- Maybe, but a mention of it might not. Some verbiage that some implementations of bash may implement a system-wide 'bashrc'

Re: bash usage w/ssh question (re: suse10.2)

2007-02-22 Thread Linda Walsh
is to screw over users who read the man page and that bash not calling profile on non-interactive logins is sortof (in their opinion) a bug...sigh. Linda Walsh wrote: *** The thing is, I'm not sure who is calling /etc/bash.bashrc. Is it part of some standard I am not aware

Re: CR in PS1, doesn't reset col to 0

2007-01-24 Thread Linda Walsh
Perfect! Wasn't familiar with that escape! Thanks. -l Mike Stroyan wrote: Bash can know about non-printing characters. Check the PROMPTING section in man bash- \[ begin a sequence of non-printing characters, which could be used to embed a terminal control sequence into the

Re: bash hash bug

2006-11-21 Thread Linda Walsh
Erp... I probably thought it was getting rid of the problem I've had in the past with ksh-type shells of retaining a bad-mapping to a file that was no longer accessible. A minor annoyance, admittedly, but one that entangled me a few times several (or more) years ago... Chet Ramey wrote: Linda

bash hash question (bug? misunderstanding?)

2006-11-19 Thread Linda Walsh
I'm having a problem in understanding the hash command in bash: Starting from a clean hash list, I issue a regular command and it is then placed in the hash list (NOTE, option hashall / set -o|grep hash# check relevant setting hashall on # has

Re: bash hash bug

2006-11-19 Thread Linda Walsh
Chet Ramey wrote: You probably have the `checkhash' shell option set. --- Yup...didn't know about that Posix requires that the command hash table be transparent, in the sense that it can only be used if the hashed command corresponds to a valid pathname. It's designed to address the

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

2006-11-07 Thread Linda Walsh
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 variable. --- From

bashdb suggestions, -: -d

2006-05-14 Thread Linda Walsh
Just started trying bashdb and noticed in the manpage that invocation with bash --debugger has option conflict problems. If it was important to eliminate those, there could be a special switch to indicate end of options similar to --, meaning to pass the rest of the arguments to a program.

Re: Selinux bash prompt decorations

2006-05-06 Thread Linda Walsh
IMO, common core utilities shouldn't be linking with specialized libraries. However, if SELinux has been adopted by Gnu.org as the standard security mechanism, and SELinux is part of the Linux-Standard-Base then it might not be unreasonable to include support for it. Is SELinux part of the

<    1   2   3   4   5   6