Re: Idea: jobs(1) -i to print only :%ID:s

2023-11-09 Thread Andreas Schwab
for multi-line commands that happen to contain matches for re. $ (sleep 100; printf $'\n[100]\n') & -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."

Re: Bash manual - possible minor formatting issue

2023-11-11 Thread Andreas Kähäri
do ... done ... as opposed to the "for" command on the form for i in some list; do ... done -- Andreas (Kusalananda) Kähäri Uppsala, Sweden .

Re: Command hangs when using process substitution

2023-11-18 Thread Andreas Schwab
rrors only (default) -quiet show informational messages on the terminal and run in the fore- ground -verbose provide a running commentary of what xclip is doing -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."

Re: Command hangs when using process substitution

2023-11-18 Thread Andreas Schwab
es) works fine in the original pipeline, without > needing the redirect to /dev/null: > > $ echo foo | tee >(xsel -i) | tr o x > fxx That's because xsel is properly daemonizing itself, disconnecting from its stdin/out/err. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprin

Re: Many of the example loadable builtins don't work anymore

2023-11-25 Thread Andreas Schwab
On Nov 25 2023, Emanuele Torre wrote: > But the bash executable still does not contain the legal_ symbols: If bash does not reference any of the symbols in lib/sh/compat.c there is nothing pulling it in. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2

Re: Missing documentation "-bash_input"

2023-11-28 Thread Andreas Schwab
et the $0 special parameter. $ bash -c 'echo $0 $2 $1' foo bar mumble foo mumble bar -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."

Re: funsub questions

2023-12-14 Thread Andreas Schwab
t; content in a single string variable, which is a questionable idea in > most programs. For interactive use, $(< ...) is convenient and less verbose than the alternatives. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Re: complete NAME seems to diasable completion for NAME in the case of git

2023-12-21 Thread Andreas Schwab
On Dez 21 2023, Britton Kerin wrote: > But if I do `complete git' at a new shell That overwrites the completion spec for git (with the empty set, ie. no completions at all). If you want to print existing completions, use complete -p [NAME...]. -- Andreas Schwab, sch...@linux-m68k.org

Re: wait -n misses signaled subprocess

2024-01-29 Thread Andreas Schwab
On Jan 29 2024, Robert Elz wrote: > I always wondered why the option was 'n' n = next? -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Re: About `M-C-e` expand result `'` failed

2024-01-30 Thread Andreas Schwab
s doing exactly what it is documented to do, that is do all of the shell word expansions. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Re: About `M-C-e` expand result `'` failed

2024-02-01 Thread Andreas Schwab
ion further. > I think that escaping is needed after quote removal in shell-expand-line. The function is called shell-expand-line, not shell-expand-and-requote-line. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "An

Re: human-friendly ulimit values?

2024-02-21 Thread Andreas Schwab
On Feb 21 2024, Christian Convey wrote: > E.g., for limiting virtual memory to 8 gigabytes, the invocation is "ulimit > -v 8388608", rather than something like "ulimit -v 8gb". Or ulimit -v $((8*1024*1024)) -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerp

Re: human-friendly ulimit values?

2024-02-29 Thread Andreas Schwab
On Feb 29 2024, Martin D Kealey wrote: > Should octal or hexadecimal be allowed (since they're easier to express > powers of two)? For this, $(( )) already provides enough support. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D

Re: Docco

2024-03-27 Thread Andreas Kähäri
confuse the two is a different matter, but the documentation is correct for the current implementation (which mimics the ksh shell with regards to the unary "-a" operator). -- Andreas (Kusalananda) Kähäri Uppsala, Sweden .

Re: Docco

2024-03-27 Thread Andreas Schwab
not performed, > because the "$2 is a binary primary" check comes first. This is how > POSIX documents it. FWIW, ksh parses it the other way round: $ ksh93 -c '[ ! -a /tmp ]; echo $?; [ . -a /tmp ]; echo $?; [ - -a /tmp ]; echo $?' 1 0 ksh93: [: -: unknown operator 2 -- And

Re: Potential Bash Script Vulnerability

2024-04-08 Thread Andreas Schwab
On Apr 08 2024, Greg Wooledge wrote: > Now imagine what happens if the shell is killed by a SIGKILL, or if > the system simply crashes during the script's execution. The script > is left with altered permissions. Or the script is executed by more than one process at the same time

Re: Bash bug with ints beyond 2147483646

2010-11-04 Thread Andreas Schwab
ile.c:438 > #6 0x0045a579 in maybe_save_shell_history () at bashhist.c:425 > #7 0x0045277b in termsig_handler (sig=11) at sig.c:525 > #8 This is definitely a bug in bash. It calls functions in the signal handler that are not async-signal-safe. Andreas. -- Andreas Schwab, sch...@linux

Re: Commands executed with $($prog) do not run properly

2010-11-08 Thread Andreas Schwab
g > find /test -type d ! -wholename "/test" > $ echo "$($prog)" > (/test shown) > (more results in original mail) Do "set -x" and note the executed commands. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: Ctrl- does nothing

2010-11-09 Thread Andreas Schwab
Greg Wooledge writes: > Crap, libncurses5-dev isn't installed. If you have neither libncurses nor libtermap then configure will use the included termacp. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 &quo

Re: Why `echo -n hello | while read v; do echo $v; done' prints nothing?

2010-12-02 Thread Andreas Schwab
"Clark J. Wang" writes: > Following command also prints nothing, confused :( > > for ((i = 0; i < 10; ++i)); do echo -n " $i"; done | while read v; do echo > $v; done $ printf . | { read v; echo $?; } 1 Andreas. -- Andreas Schwab, sch...@linux-m68k.org G

Re: comparison inside [[]] is not numeric comparison?

2010-12-09 Thread Andreas Schwab
"john.ruckstuhl" writes: > In bash, a comparison inside "[["/"]]" is lexicographic not numeric? [[ ... ]] uses the same operators as test, so if you want numeric comparison you need to use -gt, -lt, etc. > Which part of the documentation would set me straigh

Re: bash 'let' can give error

2010-12-10 Thread Andreas Schwab
Dominic Raferd writes: > Why does this happen? Is it 'by design'? $ help let [...] Exit Status: If the last ARG evaluates to 0, let returns 1; let returns 0 otherwise.. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 0

Re: bash 'let' can give error

2010-12-10 Thread Andreas Schwab
Is it 'by design'? >> >> Yes. The same as for 'expr' which is standardized by POSIX to have the >> same behavior. > > This is a design mistake: it trades a few characters for a lot of confusion. You can always choose to ignore the exit status. The co

Re: wildcard characters being evaluated improperly?

2010-12-22 Thread Andreas Schwab
rs are being evaluated locally in ALL cases. Am > I mis-understanding this concept or is there a problem in bash? Try "set -x" to see exactly what is being executed. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 21

Re: question about exit command

2011-01-19 Thread Andreas Schwab
f a reserved word, since they are only reconized where the first word of a command can occur. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: help builtin bug ???

2011-01-20 Thread Andreas Schwab
e PS2 prompt. > > arc3:~$ help () >> > > Of course that has nothing to do with the 'help' builtin. Of course it doesn't, since it just starts a function definition. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: Inconsitent treatment of * (globbing)

2011-01-31 Thread Andreas Schwab
d the file "..". ".." is not in any way special here. It is just a file that happens to start with a dot. > But if I use the expression ".*" in bash, I would expect from the > behaviour of "*", that > ".*" don't include the file

Re: Why sh does not return a false value?

2011-02-05 Thread Andreas Schwab
ince there was no preceding command the exit status is zero. The extra argument is simply ignored. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: How can i specify the scripting language used for parsing a script?

2011-02-05 Thread Andreas Schwab
Maarten Billemont writes: > The comment is called a hashbang or shebang. It tells the kernel which > program to start. Your script is passed over stdin to the interpreter. No, it isn't, it's passed as the argument. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG

Re: set -e, braces and compound commands

2011-02-11 Thread Andreas Schwab
gt;When this option is on, if a simple command fails for any of the A compound command is not a simple command. Only failing simple commands cause the shell to exit. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4

Re: Can someone explain this?

2011-02-12 Thread Andreas Schwab
com bash > /tmp Even better: $ ssh example.com bash <<\EOF cd /tmp && pwd EOF That avoids having to watch out for ' vs " quoting. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: leading 0 inconsistence?

2011-02-12 Thread Andreas Schwab
Ralf Goertz writes: > Why is 08 not tried to be interpreted as octal when *numerically* compared > using test? Because test does not know about octal for compatibility. Use [[ ... ]] if you want to be closer to $((...)). Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key finge

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

2011-02-13 Thread Andreas Schwab
Dennis Williamson writes: > _CRed='\[\033[31m\]'  #Red > _CRST='\[\033[0m\]'  #Reset > _CBLD='\[\033[1m\]'  #Bold _CRed="\\[$(tput setaf 1)\\]" _CRST="\\[$(tput sgr0)\\]" _CBLD="\\[$(tput bold)\\]" Andreas. -- Andreas Sc

Re: Bash 4.2 printf %()T seems to ignore TZ

2011-02-16 Thread Andreas Schwab
)T\n" $SECS > printf "%(%e-%b-%Y %T %Z)T\n" $SECS # added %Z > > result: > > 15:09:15 > 30-May-2010 15:09:15 CDT > > printf.right says it should be "16:09:15" in both cases. Note that the > %Z I added outputs CDT. bash fails to put TZ in its

Re: Why escape char `:' with `\' when auto completing filenames?

2011-02-17 Thread Andreas Schwab
"Clark J. Wang" writes: > I think char `:' is not special in bash. $ printf "%q\n" "$COMP_WORDBREAKS" $' \t\n"\'><=;|&(:' Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: Why escape char `:' with `\' when auto completing filenames?

2011-02-17 Thread Andreas Schwab
"Clark J. Wang" writes: > On Thu, Feb 17, 2011 at 5:00 PM, Andreas Schwab wrote: > >> "Clark J. Wang" writes: >> >> > I think char `:' is not special in bash. >> >> $ printf "%q\n" "$COMP_WORDBREAKS" >> $&

Re: Why escape char `:' with `\' when auto completing filenames?

2011-02-17 Thread Andreas Schwab
"Clark J. Wang" writes: > On Thu, Feb 17, 2011 at 6:19 PM, Andreas Schwab wrote: > >> "Clark J. Wang" writes: >> >> > On Thu, Feb 17, 2011 at 5:00 PM, Andreas Schwab > >wrote: >> > >> >> "Clark J. Wang" write

Re: Inconsistence when checking if a pattern is quoted or not for `==' and `=~' in [[ ]]

2011-02-17 Thread Andreas Schwab
] && echo 4 # quoted > bash-4.2# bash42 quoted-pattern.sh > 1 > 3 > bash-4.2# > > From my understanding 1 2 3 4 should all be printed out. "aa" contains no period, so why should it be matched? Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fing

Re: Inconsistence when checking if a pattern is quoted or not for `==' and `=~' in [[ ]]

2011-02-17 Thread Andreas Schwab
r not. The rule is the same as everywhere: a quoted character loses its special meaning. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: Why escape char `:' with `\' when auto completing filenames?

2011-02-17 Thread Andreas Schwab
"Clark J. Wang" writes: > That's the way it's implemented but that does not mean that's reasonable. So how do you suggest to solve that? Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276

Re: Inconsistence when checking if a pattern is quoted or not for `==' and `=~' in [[ ]]

2011-02-17 Thread Andreas Schwab
s sentinel word is considered "quoting". And because the > sentinel word is "quoted", parameter expansions in the body are not done. The backslash does not quote the here document, it quotes the first character of the delimiter. A (unquoted) backslash always quotes exa

Re: Why escape char `:' with `\' when auto completing filenames?

2011-02-18 Thread Andreas Schwab
Maarten Billemont writes: > Why are we escaping all word break characters? rm file:name and rm file\:name > are effectively identical, I'm not sure I see the need for escaping it. How do you differentiate between completing file:name and completing file:name? Andreas. -- Andreas

Re: Why escape char `:' with `\' when auto completing filenames?

2011-02-18 Thread Andreas Schwab
"Clark J. Wang" writes: > On Fri, Feb 18, 2011 at 5:38 PM, Andreas Schwab wrote: > >> Maarten Billemont writes: >> >> > Why are we escaping all word break characters? rm file:name and rm >> file\:name are effectively identical, I'm not sure I s

Re: Why escape char `:' with `\' when auto completing filenames?

2011-02-18 Thread Andreas Schwab
"Clark J. Wang" writes: > On Fri, Feb 18, 2011 at 6:36 PM, Andreas Schwab wrote: > >> "Clark J. Wang" writes: >> >> > On Fri, Feb 18, 2011 at 5:38 PM, Andreas Schwab > >wrote: >> > >> >> Maarten Billemont writes: >&g

Re: Brace expansion inside of command substitution - broken or is it me?

2011-02-18 Thread Andreas Schwab
echo "$(echo "1")" "$(echo "2")" "$(echo "3")" > > Counting PIDs on my sequentially-generating-PIDs OS seems to confirm that > it's running three child processes, so that lends a tiny bit of evidence > to my theory. $ set

Re: Problem with how to assign an array

2011-02-25 Thread Andreas Schwab
"Steven W. Orr" writes: > 517 > r=($(eval echo "\${${a_all[1]}[@]}")) If you use $(eval echo ...) you are almost always doing it wrong. eval "r=(\"\${${a_all[1]}[@]}\")" Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint =

Re: bash tab variable expansion question?

2011-02-25 Thread Andreas Schwab
the developer, but in my mind, this is a welcome feature. Looks like you didn't read what Michael wrote. > TAB-completion should NOT modify what I typed, Except that it does. $PWD/ and \$PWD/ are quite different things. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: bash tab variable expansion question?

2011-02-25 Thread Andreas Schwab
Greg Wooledge writes: > Fortunately the workaround was simple enough -- once the filename had > been completed I went back and x'ed out the \. Or use ~-/. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 &

Re: bash tab variable expansion question?

2011-02-26 Thread Andreas Schwab
"gnu.bash.bug" writes: > What do you mean? > > ~-/. is no equal to $PWD If you want $PWD, you can use ~+/. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: bash doesn't act like mksh at all

2011-02-28 Thread Andreas Schwab
oted=$@ >>echo "$quoted" >>echo "$unquoted" >>! >> done >> >> here bash treats unquoted $@ on rhs differently, expanding it like $*: > >Unquoted $@ *is* the same as $*. But bash treats them differently. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: vzctl enter hangs

2011-03-03 Thread Andreas Schwab
= 0 > close(7)= 0 > close(9)= 0 > close(10) = 0 > read(8, That says nothing about what the child process does. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B

Re: [bash-bug] no local bash_history created or written to if existing (~/.bash_history

2011-03-08 Thread Andreas Schwab
a (local) solution here sigsetjmp is the same as setjmp. Both will lead to deadlocks. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: Infinite loop in globbing

2011-03-14 Thread Andreas Schwab
Greg Wooledge writes: > In a NON-utf8 locale Try using a utf8 locale. The problem is that xdupmbstowcs2 fails to handle partial multibyte sequences, where mbsnrtowcs may return zero. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 4

Re: Changing window size via bind -x may cause bash to hang in futex() call

2011-03-26 Thread Andreas Schwab
Henning Bekel writes: > I've noticed that this problem does no longer occur if bash 4.2.8 is > configured --with-bash-malloc. On my distribution (arch) bash is > configured --without-bash-malloc by default. This may indicate that bash is calling malloc in a signal han

Re: Command substition failure?

2011-04-02 Thread Andreas Schwab
^ unexpected newline or end of string ++ echo '"' ++ awk '$0)' awk: $0) awk: ^ syntax error + echo '' '' Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: coprocess questions (manpage doesn't seem clear)

2011-04-12 Thread Andreas Schwab
Linda Walsh writes: > 1) If Name isn't supplied, where does it put the handles & Pid? "If NAME is not supplied, the default name is COPROC." Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5

Re: Why is command substitution happening?

2011-04-12 Thread Andreas Schwab
he Essential Etta > James (Disc 2)"' > > I'm trying to understand why command substitution is happening at all, > since the opening paren isn't preceded by a dollar sign. The paren is a red herring, you need to get rid of the backquote. (Use find instead of tree.) An

Re: eval

2011-05-04 Thread Andreas Schwab
Jonathan Nieder writes: > For the future, the sh specification at > http://www.unix.org/2008edition/ (free registration required) http://pubs.opengroup.org/onlinepubs/9699919799/ (no registration required) Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C

Re: accents

2011-05-10 Thread Andreas Schwab
Perhaps the wcwidth function is broken on MacOS. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: echo foo > a b does not error

2011-05-12 Thread Andreas Schwab
Petteri RXXty writes: > betelgeuse@pena ~/test $ echo foo > a b This is the same as: echo foo b > a Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: Bash-4.2 patches 9 and 10

2011-05-13 Thread Andreas Schwab
Eric Blake writes: > Along with an accidental announcement for a missing patch 11: > > http://lists.gnu.org/archive/html/bug-bash/2011-05/msg00028.html It's not missing, that's a 4.1 patch. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6

Re: Bash-4.2 patches 9 and 10

2011-05-13 Thread Andreas Schwab
"Joachim Schmitz" writes: > Or did something break in forwarding mails to bug-bash to the news group? Probably during the mail server move, gnu.emacs.help broke as well. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 2

Re: accents

2011-05-15 Thread Andreas Schwab
S X and its use > of both precomposed and decomposed UTF-8 than anything. There is no such thing as "precomposed UTF-8" and "decomposed UTF-8". UTF-8 is an encoding of Unicode, and both NFD and NFC are valid forms of Unicode. Andreas. -- Andreas Schwab, sch...@linux-m6

Re: accents

2011-05-16 Thread Andreas Schwab
nt concepts, the former is about physical representation of Unicode, the latter is about conversion between abstract Unicode values. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: BUG? RFE? printf lacking unicode support in multiple areas

2011-05-20 Thread Andreas Schwab
character string. Since there is no way to produce a word containing a NUL character it is impossible to support %lc in any useful way. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: Stumped on a question of scoping and unset.

2011-05-26 Thread Andreas Schwab
t - besides declaring a variable local - > protects upvars from malicious variable names: > > $ typeset 'ls -l' > bash: typeset: `ls -l': not a valid identifier > $ echo $? > 1 Unfortunately, that is subverted by the unquoted use of $1 above. Andr

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

2011-05-27 Thread Andreas Schwab
DJ Mills writes: > The only way I can think of to get the last argument in sh is to loop > through them, > something like: > for arg; do last="$arg"; done; echo "$last" $ eval echo \"\${$#}\" Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG

Re: Question about testing with variable operators

2011-06-10 Thread Andreas Schwab
ules, so you cannot use it like this. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: Problem with line buffered IO when no tty

2011-07-07 Thread Andreas Schwab
thing. BUT! if you > run it remotely, the two channels all block up till program exit and > it all comes out in one squirt. There is nothing that flushes the output before the process exits. (Nothing of this has anything to do with the shell.) Andreas. -- Andreas Schwab, sch...@linux-m6

Re: Bug, or am I confused?

2011-07-10 Thread Andreas Schwab
Linda Walsh writes: > if [[ -z "" && ((LINES < 80 )) ]]; then echo foo; fi > (prints nothing) > > What am I missing? "LINES" does not sort before "80". Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7

Re: Signals ignored by a shell cannot be handled by its sub-shells?

2011-07-12 Thread Andreas Schwab
tml#trap "Signals that were ignored on entry to a non-interactive shell cannot be trapped or reset, although no error need be reported when attempting to do so. An interactive shell may reset or catch signals ignored on entry." Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key finge

Re: ``complete -d -o default cd'' issue

2011-07-25 Thread Andreas Schwab
"Clark J. Wang" writes: > Here the cannot expand ``*.d'' to ``long-dir-name.d''. Bug? You need to add -o bashdefault for that. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5

Re: ``complete -d -o default cd'' issue

2011-07-26 Thread Andreas Schwab
"Clark J. Wang" writes: > ``-o bashdefault'' works fine for me, thanks. But from the Bash manual I > think ``-o default'' should also work: > > -o defaultUse readline's default filename completion if the compspec > generates no matches. G

Re: Fallback language for internationalized string

2011-07-27 Thread Andreas Schwab
Anders Sundman writes: > Is it possible to get bash to use a fallback language for showing > localized strings if no translation exists for the current language? > Instead of using the 'raw' msgid that is. The msgid is supossed to be the fallback. That's how

Re: Fallback language for internationalized string

2011-07-27 Thread Andreas Schwab
Eric Blake writes: > On 07/27/2011 09:05 AM, Andreas Schwab wrote: >> Anders Sundman writes: >> >>> Is it possible to get bash to use a fallback language for showing >>> localized strings if no translation exists for the current language? >>> Instead o

Re: Coproc usage ... not understanding

2011-08-03 Thread Andreas Schwab
awk would be much better suited for this task. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: Inline `ifdef style` debugging

2011-08-08 Thread Andreas Schwab
Roger writes: > [ "${DEBUG}" -ne "0" ] && $@ Missing quotes. [ "${DEBUG}" -ne 0 ] && "$@" Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

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

2011-08-09 Thread Andreas Schwab
Bob Proulx writes: > Same comment here about over-quoting. If nothing else it means that > syntax highlighting is different. > > dir=$(cd $(dirname "$path"); pwd -P) You are missing a pair of quotes here. :-) Andreas. -- Andreas Schwab, sch...@

Re: conditional aliases are broken

2011-08-15 Thread Andreas Schwab
command isn't executed until after the complete compound command was read. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: conditional aliases are broken

2011-08-15 Thread Andreas Schwab
Sam Steingold writes: > Cool. Now, what does this imply? "For almost every purpose, shell functions are preferred over aliases." Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for so

Re: exec vs. source spawning piped commands

2011-09-22 Thread Andreas Schwab
cond piped process the ability to send signals > to the first using its $PPID variable. The parent of a pipeline process is always the calling shell. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: How to match regex in bash? (any character)

2011-10-03 Thread Andreas Schwab
ages, which requires two levels of quoting if one of these languages is embedded in another one. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: Error in manual for >&word redirection

2011-10-12 Thread Andreas Schwab
rtain words, even with a space. Note that >&word (with word not a number or -) is a proper POSIX extension, since POSIX explicitly leaves it unspecified. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: Why complete doesn't print anything if it is called in a bash script?

2011-11-12 Thread Andreas Schwab
Peng Yu writes: > It is strange to me why complete doesn't print anything when it is > called in a bash script. I must have misunderstood some fundamentals. > Does anybody know why? Thanks! If complete does not print anything then there are no completions defined. Andreas. --

Re: exit status issue

2011-11-18 Thread Andreas Schwab
Dallas Clement writes: > [pid 6747] execve("/bin/touch", ["touch", "/mnt/array1/.accesstest"], > [/* 14 vars */]) = 0 > > The = 0 at the end is the exit status. No, it isn't. It only says that execve was successful. The exit status is set by

Re: exit status issue

2011-11-23 Thread Andreas Schwab
egral operation of the same interpreter. They are really the same, but even if you change it bash still wins: $ bash -c 'echo "hello"' >/dev/full bash: line 0: echo: write error: No space left on device Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA

Re: Bash-4.2 Official patch 12

2011-11-23 Thread Andreas Schwab
--- parse.y +++ parse.y @@ -5983,6 +5983,8 @@ save_input_line_state (ls) /* force reallocation */ shell_input_line = 0; shell_input_line_size = shell_input_line_len = shell_input_line_index = 0; + + return ls; } void Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key

Re: How to protect > and interpret it later on? (w/o using eval)

2011-12-04 Thread Andreas Schwab
Peng Yu writes: > This capability will be useful for debugging bash script. See trap DEBUG and shopt extdebug. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: Ill positioned 'until' keyword

2011-12-15 Thread Andreas Schwab
s no '!' operator. The 'until' > 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 l

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

2011-12-22 Thread Andreas Schwab
d as first word in a line (where it > likely introduces the paragraph describing it). > > In this case it works as well: > /@ There is an index entry for @, so i @ RET brings you directly to the description of the @ special parameter. Andreas. -- Andreas Schwab, sch...@linux-m68k.org

Re: echo '-e' doesn't work as expected, or does it?

2012-01-23 Thread Andreas Schwab
e i get: It's a bug in --enable-separate-helpfiles: the generated file contains only one help string for echo, which happens to be the one for !V9_ECHO. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: bash man page needs more examples...(i.e. >0)

2012-01-28 Thread Andreas Schwab
valid arithmetic operator (error token is > "#32") Which part of "base is a decimal number between 2 and 64" did you not understand? Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: bash man page needs more examples...(i.e. >0)

2012-01-29 Thread Andreas Schwab
quot; did you not understand? Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: UTF-8 Encode problems with \u \U

2012-02-18 Thread Andreas Schwab
return 0; >} > -if (uvalue <= UCHAR_MAX) > +if (uvalue <= CHAR_MAX) CHAR_MAX has nothing at all to do with UTF-8. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: UTF-8 Encode problems with \u \U

2012-02-18 Thread Andreas Schwab
John Kearney writes: > what I suggest will fix the UTF-8 case No, it won't. > and not affect the UTF-2 case. That is impossible. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for some

Re: UTF-8 Encode problems with \u \U

2012-02-18 Thread Andreas Schwab
John Kearney writes: > How can doing a direct assignment, in less cases break anything, Where did I say that? > And it does work for me, so impossible seems to be overstating it. How is it possible to affect UTF-8 while not affecting UTF-8? Andreas. -- Andreas Schwab, sch...@linux-m6

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

2012-02-29 Thread Andreas Schwab
John Kearney writes: > It isn't just the quote removal that is confusing. > > The escape character is also not removed and has its special meaning. The esacape character is also a quote character, thus also subject to quote removal. Andreas. -- Andreas Schwab, sch...@linux-m6

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 Andreas Schwab
t; systems. On the reporter's 64-bit amd64 system it will print out 8. But it won't help if you don't use it. diff --git a/lib/sh/zread.c b/lib/sh/zread.c index 0fd1199..3731a41 100644 --- a/lib/sh/zread.c +++ b/lib/sh/zread.c @@ -161,7 +161,7 @@ zsyncfd (fd) int fd; { off

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 Andreas Schwab
Chet Ramey writes: > That's true, and I made this change some months ago. The question is > whether or not it makes a real difference, Of course it does, int != off_t. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214

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

2012-03-13 Thread Andreas Schwab
dethrophes writes: > the missing "" in the case isn't redundant. > i.e. case "$HOME" in The word is not subject to word splitting and filename expansion, so there is no need to quote. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA

<    1   2   3   4   5   6   7   8   9   >