Re: File dtae comparison

2006-03-16 Thread Andreas Schwab
hour, I want to send an email out to the programmer. Any suggestions on the best way to do this? if test -n $(find stampfile -mmin +60); then alarm fi Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key

Re: bash-3.1.011 escaped character error

2006-03-23 Thread Andreas Schwab
Mihai Barbos [EMAIL PROTECTED] writes: When IFS is \n a single n at the end of a line is dropped. IFS=\n is equivalent to IFS=n If you want to set IFS to a single newline character use either IFS=$'\n' or IFS= Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux

Re: echo enhancement leads to confused legacy script tools...

2006-03-23 Thread Andreas Schwab
in implementation defined behaviour. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for something completely different

Re: Keybinding yank 0th arg, delete backward argument

2006-03-23 Thread Andreas Schwab
into the buffer. M-0 M-. (digit-argument yank-last-arg) (2) delete-backward-argument, similar to delete-backward-word, but should delete everything to the left until the first white space. C-w (unix-word-rubout) Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH

Re: Backquote Mystery

2006-03-27 Thread Andreas Schwab
Com MN PG P E B Consultant 3 [EMAIL PROTECTED] writes: Wenn you now do echo $e, you should get the following output: Try echo $e. Then read about Word Splitting in the Bash manual. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409

Re: `if $(cmd);' is a positive when there's no output from cmd

2006-04-15 Thread Andreas Schwab
is parsed, just like shell meta characters resulting from expansions are taken literally. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now

Re: `if $(cmd);' is a positive when there's no output from cmd

2006-04-16 Thread Andreas Schwab
Herculano Einloft [EMAIL PROTECTED] writes: Em (02:25:11), Andreas Schwab escreveu: Hey all, $ if $(echo string /dev/null); then echo true; fi true This should be a syntax error No, it is a perfectly valid command, syntactically. That the command substitution expands

Re: Bash-3.1.17 gets lost looking for end of string in certain contexts

2006-05-04 Thread Andreas Schwab
: unexpected end of file That has already been fixed. The offending lines (602 thru 607) from spencer1.script are: The offending line is actually this: status=`echo '-'| { ${GREP} -E -e 'a\' /dev/null 21 ; echo $?; }` Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products

Re: trap documentation does not match trap behavior

2006-05-11 Thread Andreas Schwab
This will run crond with SIGTERM set to SIG_IGN. Fix: Remove that sentence from the documentation? It's not wrong, just incomplete. See http://www.opengroup.org/onlinepubs/009695399/utilities/trap.html for the full details. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE

Re: terminating lines with accidental eof

2006-07-05 Thread Andreas Schwab
, otherwise it's readline that does the processing. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for something completely different

Re: The yank-last-arg (_) command and comments

2006-07-07 Thread Andreas Schwab
Thomas Mellman [EMAIL PROTECTED] writes: A recent new version of bash has changed the behavior of the yank-last-arg command (_). Is there a way to revert to the old behavior? histchars='!^ ' ie. disable the history comment character. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED

Re: Python and Bash

2006-07-20 Thread Andreas Schwab
Andrew Kezys [EMAIL PROTECTED] writes: Is there any command that will kill bash script-assosciated processes in a kind way (ie ctrl-c) when the overall script is ended? Use a trap on EXIT to do any cleanup you need. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux

Re: PATH and $0

2006-08-12 Thread Andreas Schwab
at the end, thus it differs from PATH lookup. $ (PATH=/bin:; IFS=:; for x in $PATH; do echo $x; done) | wc -l 1 Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276

Re: why doesn't this error message go to the bit bucket?

2006-08-28 Thread Andreas Schwab
the standard output was redirected to DIRLIST. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for something completely different

Re: incorrect brace expansion when using default values

2006-09-06 Thread Andreas Schwab
are quoted. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for something completely different

Re: set -e vs. !

2006-09-08 Thread Andreas Schwab
Dan Jacobson [EMAIL PROTECTED] writes: $ cat t.sh set -ex ! true #should stop here but doesn't!?! RTFM. `-e' Exit immediately if ..., unless ... the command's return status is being inverted using `!'. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE

Re: Fatal bug with redirection

2006-10-04 Thread Andreas Schwab
substitution exits without consuming its input. If you are lucky the first echo will be faster... Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now

Re: case statement breaks $( ) substitution

2006-10-06 Thread Andreas Schwab
[EMAIL PROTECTED] writes: $ echo $( case a in 1) :;; bash: syntax error near unexpected token `;;' Use (1) instead. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key

Re: Curly braces expansion not always works as expected.

2006-10-06 Thread Andreas Schwab
mwoehlke [EMAIL PROTECTED] writes: Andreas Schwab wrote: mwoehlke [EMAIL PROTECTED] writes: ...but doesn't that mean that '{x,x}' should expand as '{x,x}' It does. Huh? In the forthcoming 3.2 release anyway, so this bug has apparently already been fixed. Andreas. -- Andreas Schwab

Re: Tilde expansion not performed during variable evaluation

2006-10-11 Thread Andreas Schwab
Karen Etheridge [EMAIL PROTECTED] writes: Tilde expansion is not being performed when variables are being evaluated. This is how it is supposed to be. Tilde expansion is performed before parameter expansion, as described in the manual. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL

Re: logout from interactive subshell

2006-10-12 Thread Andreas Schwab
# Now I want to exit exit exit logout I would like to have a (interactive) command which does the final two exits plus a logout for me. exec cleartool Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany

Re: logout from interactive subshell

2006-10-12 Thread Andreas Schwab
. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for something completely different. ___ Bug-bash mailing list Bug

Re: bash 3.2 match operator problem

2006-10-12 Thread Andreas Schwab
]*)\.tgz ]]' Parens are special inside [[ ]], you need to quote them. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for something

Re: read builtin oddity/bug in bash 3.2?

2006-10-26 Thread Andreas Schwab
while in /usr/bin. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for something completely different

Re: mkfifo and tee within a function

2006-11-28 Thread Andreas Schwab
on timing. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for something completely different

Re: Bash - various feature requests

2006-12-29 Thread Andreas Schwab
of the value of parameter. However, if I use echo ${f:-3} I don't get the expected result. Read the second last sentence of the paragraph. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B

Re: Open file descriptors

2007-01-18 Thread Andreas Schwab
Richard Ray [EMAIL PROTECTED] writes: Other than lsof is there a way to determine what file descriptors are open? $ (exec 4$n) 2/dev/null echo fd $n is open Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key

Re: nocaseglob

2007-01-20 Thread Andreas Schwab
Bruce Korb [EMAIL PROTECTED] writes: $ echo tpdsrc/umod/nodesvr/test/[a-z]* tpdsrc/umod/nodesvr/test/Makefile tpdsrc/umod/nodesvr/test/SCCS tpdsrc/umod/node What are the Makefile and SCCS entries doing on the line? Please read the Bash FAQ, Question E9. Andreas. -- Andreas Schwab, SuSE

Re: help me with readline key binding problem

2007-01-21 Thread Andreas Schwab
sequences C-\ . and C-\ , to beginning-of-line. but holding down Ctrl-. or , returns nothing. As long as the terminal does not emit anything distinguishable for these keys it won't change anything. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5

Re: nocaseglob

2007-01-23 Thread Andreas Schwab
likely python has its own implementation which gets it wrong. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for something completely

Re: while read subcommand problem

2007-03-02 Thread Andreas Schwab
concurrently. Process substitution does not have this problem. while ...; do var=...; done ( generate-input-for-while ) use $var Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B

Re: signal propogation to backgrounded subshells

2007-03-06 Thread Andreas Schwab
Jeff Weber [EMAIL PROTECTED] writes: enable job control, $ set -m and kill the entire backgrounded job from a second non-interactive script? You send the signal to the process group. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5

Re: signal propogation to backgrounded subshells

2007-03-06 Thread Andreas Schwab
are orthogonal concepts. If the process group of the background job could be returned or queried when the background job is launched, That's what $! is for. Please let me know if I am misunderstanding, and thanks for your help. Don't top post. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL

Re: source(builtin) and read(2)

2007-03-23 Thread Andreas Schwab
, but result is only int. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for something completely different

Re: source(builtin) and read(2)

2007-03-23 Thread Andreas Schwab
I've never tried to source an autoconf configure script on such a system. If your ssize_t is smaller than 32 bits you'll have to worry about more things than that. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key

Re: source(builtin) and read(2)

2007-03-23 Thread Andreas Schwab
Matthew Woehlke [EMAIL PROTECTED] writes: Hmm... well then I guess this is broken: /usr/include/limits.h:#define SSIZE_MAX53248/* max single I/O size, 52K */ The creativity of system designers always amazes me. :-( Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED

Re: variable assignments and parameter expansion in a single command

2007-03-24 Thread Andreas Schwab
or just once: moo , moo more moo , more Each variable assignment shall be expanded [...] prior to assigning the value. That means that each assignment is supposed to be expanded _and_ performed in the same step while iterating over them. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED

Re: Another bash-3.2 regression: coloured prompt confuses Ctrl+R.

2007-03-29 Thread Andreas Schwab
to beginning-of-line. Perfectly reproducible with bash 3.2.15 and TERM=xterm, see the attached typescript. Note the bogus 20 ^H after the prompt is redrawn. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint

Re: Another bash-3.2 regression: coloured prompt confuses Ctrl+R.

2007-03-29 Thread Andreas Schwab
Chet Ramey [EMAIL PROTECTED] writes: I simply cannot reproduce it on the systems I have available. You need to be in a multibyte locale. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7

Re: Another bash-3.2 regression: coloured prompt confuses Ctrl+R.

2007-03-29 Thread Andreas Schwab
end of isearch, no matter how you leave it. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for something completely different

Re: Another bash-3.2 regression: coloured prompt confuses Ctrl+R.

2007-04-01 Thread Andreas Schwab
Chet Ramey [EMAIL PROTECTED] writes: OK, I'm stumped. Try again with PS1='\[\033[01;31m\]12345\[\033[01;34m\] \W \$\[\033[00m\] '. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53

Re: Result of ( false ) is 0, should be 1

2007-04-13 Thread Andreas Schwab
[EMAIL PROTECTED] writes: Description: Result of ( false ) is 0, should be 1 This is not the case. The exit code is correct, but only simple commands are causing the shell to exit with set -e. A subshell is not a simple command. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL

Re: strange expansion of (cat p.main.{optional,extra})

2007-04-18 Thread Andreas Schwab
between the braces. If it would be done strictly textual, the resulting expansion would actually be this: $ echo (cat p.main.optional) p.main.extra) which would be a syntax error. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg

Re: strange expansion of (cat p.main.{optional,extra})

2007-04-18 Thread Andreas Schwab
Lucas Nussbaum [EMAIL PROTECTED] writes: Well, no, because bash expands *parameters*, not words. So the prefix is (cat /etc/, and the suffix is ). But that would not be a *strict textual* expansion. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH

Re: strange expansion of (cat p.main.{optional,extra})

2007-04-18 Thread Andreas Schwab
Eric Blake [EMAIL PROTECTED] writes: According to Andreas Schwab on 4/18/2007 4:01 AM: Lucas Nussbaum [EMAIL PROTECTED] writes: Well, no, because bash expands *parameters*, not words. So the prefix is (cat /etc/, and the suffix is ). But that would not be a *strict textual* expansion

Re: it seems that variables red by builtin function read are modified (or ignored) during execution

2007-04-26 Thread Andreas Schwab
likely mplayer is reading from stdin. You should redirect its input to avoid that. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now

Re: Bash arithmetic doesn't give error message on wrap.

2007-04-30 Thread Andreas Schwab
, then it should display no error message in the case of $((3+078)); This is a syntax error, so there is no sensible meaning attached to it. A syntax error is something quite different than an undefined behaviour. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH

Re: Bash arithmetic doesn't give error message on wrap.

2007-04-30 Thread Andreas Schwab
. For example: result=a*b; if (result/a!=b) { report overflow; } That won't work, since (signed integer) overflow is undefined in C. A compiler is allowed to optimize the condition to false. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5

Re: How to remove a specific line in a file

2007-05-01 Thread Andreas Schwab
$SOMEFILE This is available in sed version 4 and later. Or use ed. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for something completely

Re: set function and special builtin set

2007-05-18 Thread Andreas Schwab
. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for something completely different. ___ Bug-bash mailing list

Re: last element of an array

2007-05-24 Thread Andreas Schwab
Poor Yorick [EMAIL PROTECTED] writes: The syntax I'm currently using to access the last element of an array looks a little evil: arr=( one two three ) echo ${arr[$(([EMAIL PROTECTED]))]} At least you can leave out the $((...)) construct, this is implicit. Andreas. -- Andreas Schwab, SuSE

Re: Timing an operation

2007-05-25 Thread Andreas Schwab
you need to use eval. eval interval$i='$(($date2 - $date1))' Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now

Re: tracing inside functions

2007-05-31 Thread Andreas Schwab
Chet Ramey [EMAIL PROTECTED] writes: Nic James Ferrier wrote: Using bash 2.05, does anyone know of a way to get a trace of what's happening inside a function? Only by adding `set -x' inside the function body. Or by upgrading to a shell that is not 6 years old. :-) Andreas. -- Andreas

Re: logical XOR

2007-06-29 Thread Andreas Schwab
was talking about expression evaluation. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for something completely different

Re: MacOS X 10.4.10 and Bash 3.2

2007-06-30 Thread Andreas Schwab
-prefix= (ie. empty). Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for something completely different

Re: Arithmetic expressions and parameters with newlines breaks

2007-07-02 Thread Andreas Schwab
error in expression (error token is 34) Why do you think this is a bug? Two numbers separated by whitespace cannot form a valid expression. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7

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

2007-07-17 Thread Andreas Schwab
`!'. A trap on `ERR', if set, is executed before the shell exits. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for something

Re: subshell vs. su and +e

2007-07-21 Thread Andreas Schwab
? The variable is already substituted while the here-document is read. Either quote the dollar sign, or use a quoted here-document. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756

Re: escaping exclamation in double quoted string

2007-07-28 Thread Andreas Schwab
''!'' whereas true escaping would allow the more readable echo '\!' $ echo \'\!\' Since ! is an interactive only feature there is not much problem with readability anyway. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany

Re: Help with script --

2007-08-28 Thread Andreas Schwab
Bernd Eggink [EMAIL PROTECTED] writes: t0nedef schrieb: echo Please enter a network name read ESSID if [ -n $ESSID ] You probably meant: if [ -z $ESSID ] Really you want this: if [ -z $ESSID ] Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH

Re: bash root ~/.bash_profile quirk

2007-09-06 Thread Andreas Schwab
? A setuid binary ignores LD_LIBRARY_PATH for security reasons. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for something completely

Re: builtin echo command redirection misbehaves in detached scripts when terminal is closed

2007-09-09 Thread Andreas Schwab
Stephane Chazelas [EMAIL PROTECTED] writes: That was on Linux, glibc 2.6.1. Same. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now

Re: builtin echo command redirection misbehaves in detached scripts when terminal is closed

2007-09-09 Thread Andreas Schwab
a' - is enough for me to reproduce the problem. Guess you have a buggy libc, then. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now

Re: builtin echo command redirection misbehaves in detached scripts when terminal is closed

2007-09-10 Thread Andreas Schwab
Chet Ramey [EMAIL PROTECTED] writes: What's needed is a portable interface like BSD's fpurge(3). This is also available from glibc as __fpurge (likewise on Solaris). Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany

Re: scripting help

2007-09-25 Thread Andreas Schwab
. Original - user:x:1000:100:user:/mnt/home:/bin/bash what i want - user:x:1000:100:user:/mnt/user:/bin/bash any suggestions? thanks in advance! $ awk -F: '$6 == /mnt/home { $6 = /mnt/ $1 }' input output Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH

Re: Pattern replacement fails if string contains multibyte characters

2007-09-28 Thread Andreas Schwab
. For your locale that includes characters like ä and A. You should avoid the use of ranges when not using the C locale. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3

Re: How to include `$$' literally in the PS1 prompt?

2007-09-30 Thread Andreas Schwab
Clark J. Wang [EMAIL PROTECTED] writes: Anybody has any idea? PS1='[\\$\\$=$$ \w] \$ ' Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now

Re: How to include `$$' literally in the PS1 prompt?

2007-10-07 Thread Andreas Schwab
Clark J. Wang [EMAIL PROTECTED] writes: On 9/30/07, Andreas Schwab [EMAIL PROTECTED] wrote: Clark J. Wang [EMAIL PROTECTED] writes: Anybody has any idea? PS1='[\\$\\$=$$ \w] \$ ' Sure it works but I don't think this is the way it should be. In this way, to include `\\' in the prompt

Re: Bug in getcwd implementation in lib/sh/getcwd.c

2007-10-10 Thread Andreas Schwab
with anything. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for something completely different.

Re: bash -n doesn't seem to catch all syntax errors...

2007-10-16 Thread Andreas Schwab
: `rm -f /tmp/file.+([0-9])' Can you provide insight into this. shopt changes the shell grammar. When it's not executed the modified grammar is not accepted. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key

Re: Can't unset function with unusual names

2007-10-16 Thread Andreas Schwab
AnMaster [EMAIL PROTECTED] writes: Repeat-By: $ .foo-bar() { echo test; } $ .foo-bar test $ unset .foo-bar bash: unset: `.foo-bar': not a valid identifier Use unset -f. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH

Re: Array Elements with Spaces

2007-11-10 Thread Andreas Schwab
Michael Potter [EMAIL PROTECTED] writes: countparms ${Arguments[*]} Use [EMAIL PROTECTED] instead (including the quotes). See node Arrays in the Bash docs. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key

Re: unset strangely rejects certain function names eg fu~

2007-12-12 Thread Andreas Schwab
identifier Use unset -f. (And don't work as root.) Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for something completely different.

Re: Variable passed to system contains garbage characters

2007-12-17 Thread Andreas Schwab
Patrick Nagelschmidt [EMAIL PROTECTED] writes: ++ echo '1197919330 - (1197919330 % 86400) - 86400' ++ bc -i This is bogus. Why are you forcing bc in interactive mode? Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany

Re: bash-shipped getcwd() replacement does not work on interix.

2007-12-20 Thread Andreas Schwab
. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for something completely different.

Re: Comparison failure

2008-01-10 Thread Andreas Schwab
that way, which is consistent with ksh. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for something completely different.

Re: bash does not jump where it is supposed to jump

2008-01-19 Thread Andreas Schwab
. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for something completely different.

Re: Subject: The set -o built-ins clobber the local argument variable $@

2008-02-11 Thread Andreas Schwab
[EMAIL PROTECTED] writes: set -o ignoreeof on That's the same as $ set -o ignoreeof $ set on As such it works as documented. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B

Re: Possible eval builtin speedup?

2008-03-07 Thread Andreas Schwab
filename expansion on the result of dircolors, which is significant. For example, note the time difference between echo $LS_COLORS and echo $LS_COLORS. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA

Re: Possible eval builtin speedup?

2008-03-10 Thread Andreas Schwab
Nicolas [EMAIL PROTECTED] writes: What is the role of xmbsrtowcs? Why doesn't mbsrtowcs convert 0x5c to U0x5c? SHIFT-JIS defines 0x5c to be the Yen sign U00A5. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key

Re: bash keeps too much data in memory

2008-03-13 Thread Andreas Schwab
+698,7 @@ add_char: stupidly_hack_special_variables (list-word-word); if (var) VUNSETATTR (var, att_invisible); + FREE (t2); xfree (orig_input_string); return (retval); Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409

Re: problems with 'read'ing from a pipe

2008-03-15 Thread Andreas Schwab
John Smith [EMAIL PROTECTED] writes: But I guess that you would consider that a bug in ksh ? POSIX allows both behaviours. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B

Re: for ... in ... do ignores escape characters

2008-04-18 Thread Andreas Schwab
the first one does that I'm not sure, but it's the last one you want. Both the first and the third example calls echo only once, but in the first example the argument to echo is word splitted. In the second example the word splitting is done on the expansion of `foo`. Andreas. -- Andreas Schwab

Re: Q: bash parameter expansion

2008-04-21 Thread Andreas Schwab
in turn, and the expansion is the resultant list. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now

Re: alias expansion with functions in non-interactive mode

2008-05-31 Thread Andreas Schwab
a function definition is itself a compound command. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for something completely different.

Re: Function definition syntax inconsistencies

2008-06-05 Thread Andreas Schwab
). POSIX allows function to be treated as a reserved word, even if it does not attach any meaning to it. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276

Re: $IFS and [EMAIL PROTECTED]:offset}

2008-06-06 Thread Andreas Schwab
). Is all that documented (I couldn't find it via a quick scan of the man page)? $@ expands to the positional parameters, which $0 is not (it is a special parameter). Since index 0 does not exist, $1 is the first counted parameter in the expansion. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL

Re: [POSIX conformance] . looks for file in the current directory

2008-06-10 Thread Andreas Schwab
to trojan horses that the user might be SUSv3 trying to avoid by leaving dot out of PATH . Ironically, the example just before the rationale depends exactly on finding the file in the current directory. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH

Re: Question about inline code / incompatibility between FreeBSD sh and bash

2008-06-21 Thread Andreas Schwab
/009695399/utilities/xcu_chap02.html#tag_02_10_02. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for something completely different.

Re: inconsistent treatment of backslash-bang

2008-07-22 Thread Andreas Schwab
there! [EMAIL PROTECTED]:~ echo hi there\! hi there! In which way is that wrong? Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for something

Re: Odd history clobbering.

2008-08-22 Thread Andreas Schwab
Matthew A. R. Sherian [EMAIL PROTECTED] writes: I have seen, upon occasion, that my ridiculously long HISTSIZE (10) Do you have set HISTFILESIZE too? Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key

Re: Issue with parameter and command substitution in case statement

2008-08-23 Thread Andreas Schwab
, not when part of an expansion. You can get around that rule by using eval, which rereads the argument as input to the shell. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756

Re: defualt directory problem for non-login session

2008-10-07 Thread Andreas Schwab
in the caller, before executing the shell. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for something completely different.

Re: using meta-# with large strings results in misbehavior

2008-11-28 Thread Andreas Schwab
or xterm on MacOS X. MacOS X aterm gives some weird redisplays, but only when the second numeric argument is 10, and the final display is (usually) right. I don't see your results. Set PS1='\[\e[1m\]xx\$\[\e[m\] ' and retry. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED

Readline redisplay bug with long prompt

2008-12-09 Thread Andreas Schwab
. Eventually readline miscounts the four invisible characters at the end of the prompt. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now

Re: SIGPIPE not properly reset with 'trap - PIPE'

2008-12-11 Thread Andreas Schwab
on entry to a non-interactive shell cannot be trapped or reset, although no error need be reported when attempting to do so. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B

Re: SIGPIPE not properly reset with 'trap - PIPE'

2008-12-11 Thread Andreas Schwab
. This is what bash is reporting. Andreas. -- Andreas Schwab, SuSE Labs, sch...@suse.de SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for something completely different.

Re: passing array to command line argument.

2008-12-12 Thread Andreas Schwab
executing. Better yet: set -x to get an accurate view of the command, including quoting. Andreas. -- Andreas Schwab, SuSE Labs, sch...@suse.de SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now

Re: command substitution and word splitting

2008-12-13 Thread Andreas Schwab
--prefix=... $(myflags) Andreas. -- Andreas Schwab, SuSE Labs, sch...@suse.de SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for something completely different.

Re: coprocess suggestions

2009-01-14 Thread Andreas Schwab
followed by a compound-command can also be interpreted as a simple-command where NAME is the first word of it. Andreas. -- Andreas Schwab, SuSE Labs, sch...@suse.de SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B

  1   2   3   4   5   6   7   >