Re: Crash on jobs 2^32-2

2018-07-13 Thread isabella parakiss
but... 4278190079 != 2^32-2... anything above 2^31 will do On 7/12/18, Chet Ramey wrote: > On 7/11/18 9:41 AM, Simon Wörner wrote: >> Dear all, >> The following crash was found by a modified >> version of the kAFL fuzzer (https://github.com/RUB-SysSec/kAFL). >> >> The crash can be reproduced by r

Re: [annoyance/non-feature] On OS X, every process is "occupying" CWD, making disk ejects impossible after cd'ing into them.

2018-01-16 Thread isabella parakiss
hack the kernel and fix the bug in osx where it's supposed to be fixed On 1/16/18, Danyel Bayraktar wrote: > I asked on StackExchange prior to this: > https://apple.stackexchange.com/questions/310965/stop-iterm2-from-using-disk-disk-cannot-be-ejected >

this makes sense

2017-12-17 Thread isabella parakiss
IFS=_ foo_bar=well; set foo bar; echo "i'm a ${!@} designed language"

declare can set variable attributes to functions

2016-12-30 Thread isabella parakiss
$ f () { echo hello; }; declare -fail f; declare -pf f f () { echo hello } declare -afil f=() i don't think this causes any real problem but obviously it looks wrong happens in 4.3 and 4.4 and the latest devel snapshot --- xoxo iza

Re: ``read -N n -t timeout'' saves partial input only when EOF is seen?

2016-11-24 Thread isabella parakiss
On 11/24/16, Chet Ramey wrote: > On 11/24/16 2:57 AM, Clark Wang wrote: >> See following example: >> >> # echo $BASH_VERSION >> 4.4.5(2)-release >> # ( printf 12345 ) | ( read -t 1 -N 10 v; echo "<$v>" ) >> <12345> >> # ( printf 12345; sleep 2 ) | ( read -t 1 -N 10 v; echo "<$v>" ) >> <> >> # >> >

add ifdef for readline in shopt.def

2016-11-19 Thread isabella parakiss
enable_hostname_completion is not declared without readline --- xoxo iza From 38e94c427a1b87680b54c3820777ed55c662f90e Mon Sep 17 00:00:00 2001 From: izabera Date: Sat, 19 Nov 2016 20:15:47 +0100 Subject: [PATCH] add ifdef for readline in shopt.def --- builtins/shopt.def | 4 +++- 1 file change

TIMEFORMAT in time ( )

2016-10-16 Thread isabella parakiss
$ cat myscript TIMEFORMAT=foo var=x time ( TIMEFORMAT=bar var=y ) echo "<$TIMEFORMAT> <$var>" f() { TIMEFORMAT=f; time :; } time ( f ) echo "<$TIMEFORMAT>" $ bash myscript bar f f setting TIMEFORMAT in ( ) affects time out of the subshell this cannot be right --- xoxo iza

wait and procsubs

2016-10-10 Thread isabella parakiss
wait doesn't wait for procsubs unless it's passed the pid as an argument $ time { : <(sleep 1); wait; } real: 0m0.002s, user: 0m0.000s, sys: 0m0.003s $ time { : <(sleep 1); wait $!; } real: 0m1.011s, user: 0m0.003s, sys: 0m0.007s is this intended or is it a bug? this also means it's impossible t

Re: Magnitude of Order "For Loop" performance deltas based on syntax change

2016-09-27 Thread isabella parakiss
On 9/26/16, Dan Douglas wrote: > Would an array of pointers to structs of key-value pairs be better > here? It should be faster in the common cases even though it may mean > some wasted space and reallocs depending on how you decide to grow the > array. A linear search through an array for an inde

Re: [BUG] false positive: [ ! -o optname ]

2016-09-25 Thread isabella parakiss
On 9/25/16, Martijn Dekker wrote: > The '!' operator in the legacy test/[ builtin does not invert the result > of the -o operator. Consequently the command > > [ ! -o noclobber ] > > amounts to a no-op, always returning exit status 0. > > Proof: > > $ set -o noclobber && [ -o noclobber ] &&

[PATCH] fix printf %b without an argument

2016-09-23 Thread isabella parakiss
here's a patch that fixes this problem $ printf "<%3s><%3b>" < ><> --- xoxo iza From c5ffd55ffa9224dd7919a4d09b27a11308d2152e Mon Sep 17 00:00:00 2001 From: izabera Date: Sat, 24 Sep 2016 02:01:16 +0200 Subject: [PATCH] fix printf %b without an argument old behavior: $ printf "<%3s><%3b>" <

[no subject]

2016-06-22 Thread isabella parakiss
From 6732f0277455ff8d8c6a09261490377890dc986d Mon Sep 17 00:00:00 2001 From: izabera Date: Wed, 22 Jun 2016 22:43:53 +0200 Subject: [PATCH] fix a couple of bugs in print_cmd.c 1. print all heredoc headers before printing their contents 2. don't print all the heredocs after any other redir sample

extglob problems

2016-03-23 Thread Isabella Parakiss
Just wanted to report a couple of problems in 4.3.42 and the latest devel version: *?(/) followed by something makes it ignore the rest: $ [[ a = a*?(/)b ]] && echo match match @(*|extglob) matches everything(?) but not always: $ touch a b c .x .y .z $ echo .!(|.) # correct .x

Re: why does time (cmd) 2> file redirect time's output?

2016-03-08 Thread Isabella Parakiss
On Fri, Jan 29, 2016 at 12:08:38PM -0500, Chet Ramey wrote: > On 1/27/16 5:59 AM, Stephane Chazelas wrote: > > Hello, > > > > (tested with bash-4.3 and bash-2.05b) > > > > "time" is meant to time a pipeline. That generally includes > > redirections of the last command in the pipeline, but in the

Re: GLOBIGNORE documentation

2016-03-06 Thread Isabella Parakiss
On Sun, Mar 06, 2016 at 10:16:58PM +, Stephane Chazelas wrote: > Today, I realised that GLOBIGNORE doesn't work at all like ksh's > FIGNORE. > > With > > GLOBIGNORE=x* > > we're not filtering out files whose *name* starts with "x" from > globs but those whose *path* starts with "x". > > In

add ifdefs for BASH_HISTORY

2016-02-11 Thread isabella parakiss
This is needed to configure with --disable-bash-history -- xoxo iza diff --git a/bashhist.c b/bashhist.c index dc26d30..6a16bdf 100644 --- a/bashhist.c +++ b/bashhist.c @@ -229,6 +229,7 @@ bash_history_inhibit_expansion (string, i) return (1); #endif +#if defined (BANG_HISTORY) /* Ma

Re: feature request: store lines before history expansion

2015-12-10 Thread isabella parakiss
On 12/10/15, Hans Ginzel wrote: > Hello! > > I would appreciate if bash could optionally > (some option – on by default when histexpand is set) > store the command line *before* history expansion > additionally to expanded line. > > Regards, > Hans > Just curious, why? --- xoxo iza

\177 at the end of a variable

2015-11-23 Thread isabella parakiss
$ str=abcd; [[ $'a\177' = a"${str:4:1}" ]]; echo $? 0 This happens in every version since 3.1, including the devel branch. --- xoxo iza

Re: Proposed Prompt Escapes

2015-11-18 Thread isabella parakiss
On 11/19/15, Ángel González wrote: > Dennis Williamson wrote: >> Do you mean something like: >> >> PS1='$SECONDS ' > > Not exactly. $SECONDS is the number of seconds since the shell was > started. I am interested in the seconds elapsed by the last command. > > It is a hacky solution, but it could

Re: bash-4.3: casemod word expansions broken with UTF-8

2015-11-16 Thread isabella parakiss
On 11/15/15, Ulrich Mueller wrote: > Description: > In an UTF-8 locale like en_US.UTF-8, the case-modifying > parameter expansions sometimes return invalid UTF-8 encodings. > > This seems to happen when the UTF-8 byte sequences that are > encoding upper and lower case have

unsetting from BASH_ALIASES

2015-10-26 Thread isabella parakiss
man bash claims that unsetting elements from BASH_ALIASES causes them to be removed from the alias list. This doesn't work and from what I can see in variables.c there's nothing that's called when an element in a dynamic variable is unset. Is there any plan to support this? --- xoxo iza

Re: problem with @A and arrays

2015-10-18 Thread isabella parakiss
On 10/18/15, Chet Ramey wrote: > (BTW, your patch does not result in a valid declare command with a > correct compound assignment.) > Yes I'm sorry, I noticed it after sending the message... --- xoxo iza

Re: language inconsistency(wart) & RFE

2015-10-16 Thread isabella parakiss
On 10/17/15, Linda Walsh wrote: > Ok, thinking this from a different way. > > shopt -s implicit_vars_local > or > shopt -s localize_func_implicit_vars whatever... > > Right now, in a function, you *can* use local in a function > to make a local var. Thing is, both 'declare' and 'typeset' also

problem with @A and arrays

2015-10-16 Thread isabella parakiss
${array[@]@A} splits the values. $ a=("ab" "c d"); printf "<%s>" "${a[@]@A}" <-a><[1]="c> diff --git a/subst.c b/subst.c index 2a7366f..d7258b8 100644 --- a/subst.c +++ b/subst.c @@ -4796,18 +4796,26 @@ array_var_assignment (v, itype, quoted) { char *ret, *val, flags[MAX_ATTRIBUTES];

warnings with compgen -C and -F

2015-10-14 Thread isabella parakiss
What's the point of these two warnings in builtins/complete.def ? if (Farg) builtin_error (_("warning: -F option may not work as you expect")); if (Carg) builtin_error (_("warning: -C option may not work as you expect")); Can they be removed? It's stupid to provide a function, and wa

Re: ! in PS1 in posix mode

2015-10-12 Thread isabella parakiss
On 10/12/15, Greg Wooledge wrote: > On Mon, Oct 12, 2015 at 09:28:42AM -0700, Linda Walsh wrote: >> Chet Ramey wrote: >> >http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_05_03 >> > >> >"The shell shall replace each instance of the character '!' in PS1 with >> >the h

Re: trap DEBUG and $_

2015-10-11 Thread isabella parakiss
On 10/11/15, Dan Stromberg wrote: > Is there a way of outputting a datestamp to shell stderr at the _beginning_ > of the execution of a command, that won't wipe out $_? > > I use $_ quite a bit for the last argument to the previous command, > interactively. And I'd like to datestamp all my comman

Re: ! in PS1 in posix mode

2015-10-10 Thread isabella parakiss
On 10/11/15, isabella parakiss wrote: > In posix mode, bash replaces ! in my PS1 with the history number. > > $ PS1=' ! ' > ! set -o posix > 513 exit > > It doesn't happen with any other prompt escape sequence, afaict. > This looks... intentional? W

! in PS1 in posix mode

2015-10-10 Thread isabella parakiss
In posix mode, bash replaces ! in my PS1 with the history number. $ PS1=' ! ' ! set -o posix 513 exit It doesn't happen with any other prompt escape sequence, afaict. This looks... intentional? WTF? --- xoxo iza

read and env variables

2015-10-10 Thread isabella parakiss
$ a= read a <<< x # this creates a variable in the current shell $ declare -p a declare -- a="x" $ b= mapfile b <<< x# this doesn't $ declare -p b bash: declare: b: not found Other shells don't seem to agree on what should happen in this case, but it'd be nice to have a more consistent

check if DEBUG is defined in trap.c

2015-09-25 Thread isabella parakiss
diff --git a/trap.c b/trap.c index bf911ac..0a47f19 100644 --- a/trap.c +++ b/trap.c @@ -320,7 +320,9 @@ run_pending_traps () while (pending_traps[sig]--) instead of the if statement. */ if (pending_traps[sig]) { +#if defined (DEBUG) itrace("run_pending_traps: %d: %d", sig,

Problem with @Q

2015-08-28 Thread isabella parakiss
In the devel branch, setting IFS=\' seems to break @Q: $ arr=(a b c) $ echo ${arr[@]@Q} | sed -n l 'a' 'b' 'c'$ <- correct $ echo "${arr[@]@Q}" | sed -n l 'a' 'b' 'c'$ <- correct $ IFS=\' $ echo ${arr[@]@Q} | sed -n l a b c$

Re: coredump with wait -n

2015-08-23 Thread isabella parakiss
On 8/22/15, Chris F.A. Johnson wrote: > On Sat, 22 Aug 2015, isabella parakiss wrote: > >> Hi, after running wait -n there's something wrong, ^C doesn't work >> properly anymore: it displays ^C in the readline buffer, but the current >> line stays there until I

coredump with wait -n

2015-08-22 Thread isabella parakiss
Hi, after running wait -n there's something wrong, ^C doesn't work properly anymore: it displays ^C in the readline buffer, but the current line stays there until I press enter. Running any command "fixes" it. It can also dump core if you try with multiple jobs. $ bash --norc bash-4.3$ sleep 1

Re: quoted compound array assignment deprecated

2015-08-18 Thread isabella parakiss
On 8/18/15, Chet Ramey wrote: > On 8/17/15 4:19 AM, isabella parakiss wrote: >> Quoting is necessary in a few cases: >> >> $ var=foo; declare -A "arr$var=([x]=y)" >> bash: warning: arrfoo=([x]=y): quoted compound array assignment >> deprecated >&

quoted compound array assignment deprecated

2015-08-17 Thread isabella parakiss
Quoting is necessary in a few cases: $ var=foo; declare -A "arr$var=([x]=y)" bash: warning: arrfoo=([x]=y): quoted compound array assignment deprecated $ var=foo; declare -A arr$var=([x]=y) bash: syntax error near unexpected token `(' $ var=foo; declare -A "arr$var"=([x]=y) bash: syntax error near

declare -f produces non eval'able output

2015-08-13 Thread isabella parakiss
declare -f doesn't know that most keywords are valid function names: $ function time () { :; } $ declare -f time time () { : } It should probably check if the name is if/for/time... before printing it. --- xoxo iza

Re: -e does not take effects in subshell

2015-08-12 Thread isabella parakiss
On 8/13/15, Eric Blake wrote: > Like it or not, it is the historical behavior standardized by POSIX. It > is NOT intuitive, and our advice is "DON'T USE set -e - IT WON'T DO WHAT > YOU WANT". We can't change the behavior, because it would break scripts > that rely on the POSIX-specified behavior.

problems with traps

2015-08-12 Thread isabella parakiss
This segfaults when it receives a SIGUSR1: #!/bin/bash trap ': $(:) < <(:)' USR1 while :; do sleep 1; done I also received a bunch of scary errors like these: *** Error in `/bin/bash': munmap_chunk(): invalid pointer: 0x02680f80 *** *** Error in `/bin/bash': corrupted double-linked list:

segfault when indirectly expanding negative numbers

2015-08-12 Thread isabella parakiss
Bash segfaults when trying to do this: x=-3; echo ${!x} Here's the backtrace from gdb: https://gist.github.com/306f16a358527b267a1e It looks like the problem is the savestring macro when ind is negative. --- xoxo iza

nocaseglob and =~

2015-08-04 Thread isabella parakiss
nocaseglob affects regex matching in [[ but according to the man page only nocasematch should: nocaseglob If set, bash matches filenames in a case-insensitive fashion when performing pathname expansion (see Pathname Expansion above). nocasematch If set, bash matches patterns in a case-insens

Re: cannot declare local variables if they're readonly

2015-07-23 Thread isabella parakiss
On 7/23/15, Chet Ramey wrote: > This is an excellent time to point out that it's to everyone's advantage > to be as complete as possible when describing a problem on the list, > rather than revealing additional details one at a time. > > There's no way anyone would have guessed that you were encou

Re: cannot declare local variables if they're readonly

2015-07-23 Thread isabella parakiss
ot want the user to unlock. The entity who used > "readonly" is presumed to want that variable to remain unchanged, forever. On 7/23/15, Stephane Chazelas wrote: > 2015-07-23 01:12:01 +0200, isabella parakiss: > What that means is that with this kind of dynamic scoping, >

cannot declare local variables if they're readonly

2015-07-22 Thread isabella parakiss
>From variables.c The test against old_var's context level is to disallow local copies of readonly global variables (since I believe that this could be a security hole). Can you please explain how that can be a security hole? $ readonly wtf; fn (

extra \1 in declare -p

2015-07-20 Thread isabella parakiss
Hi, about this bug: http://lists.gnu.org/archive/html/bug-bash/2003-03/msg00093.html The fix was to add this in lib/sh/shquote.c else if (c == CTLESC || c == CTLNUL) *r++ = CTLESC; I think the fix it was applied twice, it should only check this in the prompt string, right? Now dec

problem with HISTCONTROL

2015-07-11 Thread isabella parakiss
When the value of HISTCONTROL is ignoredups or ignoreboth, if you enter a command and then open the editor and add lines to it without changing the first line, only the first line will be stored in the history. I'm terrible at explaining, but I recorded what happens: https://asciinema.org/a/23275

problem with local -

2015-07-10 Thread isabella parakiss
Using local - calls set_ignoreeof() when unwinding "function_calling". As a result, you have to press ^D 10 times to exit the shell. Anyway, $IGNOREEOF is not changed and shopt -o ignoreeof reports off. I'm attaching the relevant part of a backtrace from gdb. --- xoxo iza gdb-trace Description

?:

2015-06-22 Thread isabella parakiss
In lib/readline/input.c line 108 return (_isatty (fd) ? long) (HANDLE) _get_osfhandle (fd)) & 3) == 3) ? 0); I think you mean return x ? y : z; Unfortunately I don't have a windows machine to test it... --- xoxo iza

Re: Consequences of shell errors

2015-06-18 Thread isabella parakiss
On 6/18/15, Nick Stoughton wrote: > > set -e > export X=$(false) > # should not reach here > echo did not exit > > But every shell I tested behaves the same way (sh, bash, dash, ksh, mksh, > yash and zsh), so I feel I must be missing something. Can someone explain > why the first 2 examples do no

vi-insertion-mode is never bound according to bind -p

2015-05-29 Thread isabella parakiss
$ bind -p -m vi | grep vi-insertion # vi-insertion-mode (not bound) This was introduced in bash 4.0 and conflicts with the readline docs. Small patch below... --- xoxo iza lib/readline/funmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/readline/funmap.c b/lib/r

Check linux 4

2015-05-25 Thread isabella parakiss
This is from configure.ac linux*) LOCAL_LDFLAGS=-rdynamic # allow dynamic loading case "`uname -r`" in 2.[[456789]]*|3*) AC_DEFINE(PGRP_PIPE) ;; esac ;; It doesn't check for linux 4. --- xoxo iza

fc and the verbose mode

2015-05-17 Thread isabella parakiss
fc activates the verbose mode to print the commands as they're read by the parser and uses unwind_protect_int to restore it. This is a good idea but there are a few problems with it: 1. it prints the DEBUG trap, which I didn't expect 2. it's impossible to use fc to turn on/off the verbose mode

Re: [PATCH] check empty callback in mapfile

2015-05-10 Thread isabella parakiss
Ignore the patch, it's stupid. Maybe check if the callback is a function? --- xoxo iza

[PATCH] check empty callback in mapfile

2015-05-10 Thread isabella parakiss
In builtins/mapfile.def there's this line: snprintf (execstr, execlen, "%s %d %s", callback, curindex, qline); If the callback is empty, bash runs '' This smells a lot like code injection. $ echo 'echo hello from $0' > ~/bin/0 $ chmod +x ~/bin/0 $ cp ~/bin/{0,1} $ echo -e 'x\ny' | mapfile -c1 -C

Re: [PATCH] replace patterns in empty strings

2015-05-06 Thread isabella parakiss
Sorry, the previous patch was wrong, it enters an endless loop when replacing all the occurrencies in ${var//pat/rep} Attached the correct one (I think). Tests: $ ./bash -c 'var=; echo "${var/#/x}"' x $ ./bash -c 'var=; echo "${var/*/x}"' x $ ./bash -c 'var=; echo "${var//*/x}"' x $ ./bash -c 'va

[PATCH] replace patterns in empty strings

2015-05-06 Thread isabella parakiss
I think this is wrong: var= ; echo "${var/*/x}" It should print x but it prints nothing. The attached patch fixes this, I hope it's ok. I don't know what's the correct behaviour in case $var is unset, but it's probably worth to look at, since bash prints nothing in that case too. --- xoxo iza

Re: [PATCH] added -- in autocd

2015-04-28 Thread isabella parakiss
On 4/28/15, Eric Blake wrote: > On 04/28/2015 12:44 PM, isabella parakiss wrote: >> --- > > Might have been nice to leave a comment why you propose this change. It > looks like it is needed for the case when autocd mode is on and you type > the name of a directory that start

[PATCH] added -- in autocd

2015-04-28 Thread isabella parakiss
--- execute_cmd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/execute_cmd.c b/execute_cmd.c index e3aa37f..51c29c6 100644 --- a/execute_cmd.c +++ b/execute_cmd.c @@ -4283,6 +4283,7 @@ run_builtin: if (autocd && interactive && words->word && is_dirname (words->word->word)) { +

Re: declare -p doesn't show the global attribute

2015-04-26 Thread isabella parakiss
On 4/27/15, Chet Ramey wrote: > On 4/26/15 5:26 PM, isabella parakiss wrote: >> $ fn () { declare -g var=x; declare -p var; } ; fn >> declare -- var="x" >> >> I think the correct output should be declare -g var="x" >> Is this intended or i

declare -p doesn't show the global attribute

2015-04-26 Thread isabella parakiss
$ fn () { declare -g var=x; declare -p var; } ; fn declare -- var="x" I think the correct output should be declare -g var="x" Is this intended or is it a bug? --- xoxo iza

Problem with bind -x

2015-04-21 Thread isabella parakiss
I noticed a problem with bind -x: readline re-prints the line if the function is called when the cursor is not in the first line. To reproduce it (and to understand what I mean, if it's not clear): prompt$ myfunc () { :; } prompt$ bind -x '"\C-a":myfunc' Now write a line that's long enough to w

Re: associative arrays and [[ -v

2015-04-19 Thread isabella parakiss
On 4/20/15, Chet Ramey wrote: > On 4/17/15 6:45 PM, isabella parakiss wrote: > >> This seems the way to go, but I'm not sure I understand why: >> >> $ declare -A arr=([a]=b) >> $ [[ -v arr['$var'] ]]; echo $? >> 1 >> $ declare

Re: associative arrays and [[ -v

2015-04-17 Thread isabella parakiss
(Sorry the previous message lacked the declaration of var, it was an asterisk obviously) $ var=* $ declare -A arr=([a]=b) $ [[ -v arr['$var'] ]]; echo $? 1 $ declare -A arr=(['*']=x) $ [[ -v arr['$var'] ]]; echo $? 0 --- xoxo iza On 4/18/15, isabella parakiss w

Re: associative arrays and [[ -v

2015-04-17 Thread isabella parakiss
On 4/17/15, Chet Ramey wrote: > On 4/17/15 5:12 AM, isabella parakiss wrote: >> I need to check if an element in an associative array is set. What's the >> correct way to test it? > > If *any* element is set, or if a particular element is set? > >>

Re: associative arrays and [[ -v

2015-04-17 Thread isabella parakiss
On 4/17/15, Eduardo A. Bustamante López wrote: > On Fri, Apr 17, 2015 at 11:12:50AM +0200, isabella parakiss wrote: >> I need to check if an element in an associative array is set. What's the >> correct way to test it? > > dualbus@yaqui ~ % export key; for key in \* x

associative arrays and [[ -v

2015-04-17 Thread isabella parakiss
I need to check if an element in an associative array is set. What's the correct way to test it? $ declare -A arr=([x]=y); var=* $ [[ -v arr["$var"] ]]; echo $? 0 $ [[ ${arr["$var"]} ]]; echo $? 1 The former seems wrong, the glob is expanded even if "$var" is quoted. The latter works but it do

read -N ignores IFS

2015-03-29 Thread isabella parakiss
$ read -n 100 a b <<< 'x y'; declare -p a b declare -- a="x" declare -- b="y" $ read -N 100 a b <<< 'x y'; declare -p a b declare -- a="x y " declare -- b="" >From my understanding of the documentation, read -N should ignore the delimiter (-d), not the IFS. If the current behaviour is correct, a

Re: read -e deletes extra characters

2015-03-24 Thread isabella parakiss
On 3/24/15, Chet Ramey wrote: > There are a number of unjustified expectations here. The biggest is that > readline can know about characters printed to the screen by another > program. Readline expects to be able to use the entire line and that it > begins with the cursor in column 0. This can

read -e deletes extra characters

2015-03-23 Thread isabella parakiss
rlwrap is a nice utility that enables readline's features in utilities that don't provide them. I tried to rewrite something similar in bash so here's a sketch of the code: while read -re; do history -p -- "$REPLY" history -s -- "$REPLY" done | ... The problem is when I pipe that to a progr

Re: [PATCH] time-fmt-escapes

2015-03-17 Thread isabella parakiss
The mail destroyed my tabs :( Patch attached, this time... --- xoxo iza 0001-time-fmt-escapes.patch Description: Binary data

[PATCH] time-fmt-escapes

2015-03-17 Thread isabella parakiss
>From 2157400e3de983c358b580bb8cd22b337cd87eae Mon Sep 17 00:00:00 2001 From: izabera Date: Tue, 17 Mar 2015 20:30:11 +0100 Subject: [PATCH] time-fmt-escapes --- builtins/printf.def | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/builtins/printf.def b/builti

Re: IFS is ignored when concatenating array elements

2015-03-15 Thread isabella parakiss
On 3/14/15, Le Manh Cuong wrote: > In bash, you need to quote in second arr assignment: > $ arr=(a b c); IFS=+; arr="${arr[*]/a/x}"; echo "$arr"x+b+c > A note that the result from those shells are different. After second > assignment to arr: > - In bash and ksh, arr still be an array, contain 3 el

IFS is ignored when concatenating array elements

2015-03-13 Thread isabella parakiss
This works as I would expect: $ arr=(a b c); IFS=+; echo "${arr[*]/a/x}" x+b+c But for some reason, this ignores IFS: $ arr=(a b c); IFS=+; arr=${arr[*]/a/x}; echo "$arr" x b c Here is the behaviour of other shells that allow that kind of syntax: input: arr=(a b c); IFS=+; echo "${arr[*

Re: Unsetting all elements of an associative array

2015-02-05 Thread isabella parakiss
On 2/4/15, konsolebox wrote: > Logically that should only unset the elements of an array and not the > array variable > itself since '*' or '@' is more of a wildcard that represents the > indices. However, bash > does otherwise: > > #define ALL_ELEMENT_SUB(c)((c) == '@' || (c) == '*') > > .

Unsetting all elements of an associative array

2015-02-04 Thread isabella parakiss
I'm trying to use unset array[@] to empty an associative array, but something goes wrong. This behaves as expected: $ declare -A array; array[path/directory]=value This produces an error: $ declare -A array; unset array[@]; array[path/directory]=value bash: path/directory: division by 0 (error to

Re: read -t

2015-01-04 Thread isabella parakiss
ould be used as typeahead. But that's not the case, and I don't understand why. 2015-01-04 17:21 GMT+01:00, Chet Ramey : > On 1/4/15 12:45 AM, isabella parakiss wrote: >> I'm trying to use read -t in an interactive shell >> >> read -t 3 *press random key

read -t

2015-01-04 Thread isabella parakiss
I'm trying to use read -t in an interactive shell read -t 3 *press random keys* Everything i press is now part of the next command in the prompt. It only happens when the delimiter is a \n. Is this intended? What's the point?