[PATCH] tests/array.tests: using grep -E instead of egrep

2024-02-19 Thread Xiangyu Chen
From: Xiangyu Chen 

The console ouput lots of egrep warning message, those message causes test case 
fail in diff stage.
According the message, using grep -E instead of egrep.

Warning message:
---
9d8
< egrep: warning: egrep is obsolescent; using grep -E
31d29
< egrep: warning: egrep is obsolescent; using grep -E
34d31
< egrep: warning: egrep is obsolescent; using grep -E
37d33
< egrep: warning: egrep is obsolescent; using grep -E
41d36
< egrep: warning: egrep is obsolescent; using grep -E
65d59
< egrep: warning: egrep is obsolescent; using grep -E
84d77
< egrep: warning: egrep is obsolescent; using grep -E
---

Signed-off-by: Xiangyu Chen 
---
 tests/array.tests | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tests/array.tests b/tests/array.tests
index d0bb08b..5cac808 100644
--- a/tests/array.tests
+++ b/tests/array.tests
@@ -16,7 +16,7 @@
 set +o posix
 
 set +a
-# The calls to egrep -v are to filter out builtin array variables that are
+# The calls to grep -E are to filter out builtin array variables that are
 # automatically set and possibly contain values that vary.
 
 # first make sure we handle the basics
@@ -61,7 +61,7 @@ echo ${a[@]}
 echo ${a[*]}
 
 # this should print out values, too
-declare -a | egrep -v '(BASH_VERSINFO|PIPESTATUS|GROUPS)'
+declare -a | grep -E -v '(BASH_VERSINFO|PIPESTATUS|GROUPS)'
 
 unset a[7]
 echo ${a[*]}
@@ -92,11 +92,11 @@ echo ${a[@]}
 readonly a[5]
 readonly a
 # these two lines should output `declare' commands
-readonly -a | egrep -v '(BASH_VERSINFO|PIPESTATUS|GROUPS)'
-declare -ar | egrep -v '(BASH_VERSINFO|PIPESTATUS|GROUPS)'
+readonly -a | grep -E -v '(BASH_VERSINFO|PIPESTATUS|GROUPS)'
+declare -ar | grep -E -v '(BASH_VERSINFO|PIPESTATUS|GROUPS)'
 # this line should output `readonly' commands, even for arrays
 set -o posix
-readonly -a | egrep -v '(BASH_VERSINFO|PIPESTATUS|GROUPS)'
+readonly -a | grep -E -v '(BASH_VERSINFO|PIPESTATUS|GROUPS)'
 set +o posix
 
 declare -a d='([1]="" [2]="bdef" [5]="hello world" "test")'
@@ -111,7 +111,7 @@ b=([0]=this [1]=is [2]=a [3]=test [4]="$PS1" [5]=$pass)
 
 echo ${b[@]:2:3}
 
-declare -pa | egrep -v '(BASH_VERSINFO|PIPESTATUS|GROUPS)'
+declare -pa | grep -E -v '(BASH_VERSINFO|PIPESTATUS|GROUPS)'
 
 a[3]="this is a test"
 
@@ -129,7 +129,7 @@ d=([]=abcde [1]="test test" [*]=last [-65]=negative )
 unset d[12]
 unset e[*]
 
-declare -a | egrep -v '(BASH_VERSINFO|PIPESTATUS|GROUPS)'
+declare -a | grep -E -v '(BASH_VERSINFO|PIPESTATUS|GROUPS)'
 
 ps1='hello'
 unset ps1[2]
@@ -155,7 +155,7 @@ echo ${vv[0]} ${vv[3]}
 echo ${vv[@]}
 unset vv
 
-declare -a | egrep -v '(BASH_VERSINFO|PIPESTATUS|GROUPS)'
+declare -a | grep -E -v '(BASH_VERSINFO|PIPESTATUS|GROUPS)'
 
 export rv
 #set
-- 
2.25.1




Re: [PATCH] tests/array.tests: using grep -E instead of egrep

2024-02-19 Thread Lawrence Velázquez
On Mon, Feb 19, 2024, at 4:08 AM, Xiangyu Chen wrote:
> From: Xiangyu Chen 
>
> The console ouput lots of egrep warning message, those message causes 
> test case fail in diff stage.

On what system does this happen?  The proposed changes might break the test 
suite on some older systems.

-- 
vq



Re: [PATCH] tests/array.tests: using grep -E instead of egrep

2024-02-19 Thread Koichi Murase
2024年2月19日(月) 18:01 Lawrence Velázquez :
> On Mon, Feb 19, 2024, at 4:08 AM, Xiangyu Chen wrote:
> > From: Xiangyu Chen 
> >
> > The console ouput lots of egrep warning message, those message causes
> > test case fail in diff stage.
>
> On what system does this happen?  The proposed changes might break the test 
> suite on some older systems.

GNU grep started to output error messages in v3.8 (2022-09) for egrep,
so the test failure will be happening in most GNU/Linux distributions
soon.



Re: possible bash bug bringing job. to foreground

2024-02-19 Thread alex xmb sw ratchev
On Sat, Feb 17, 2024, 20:54 Greg Wooledge  wrote:

> On Sat, Feb 17, 2024 at 07:41:43PM +, John Larew wrote:
> > After further examination, the examples with "fg $$" and "fg $!" clearly
> do not bring the subshell into the foreground, as they are evaluated prior
> to the subshells background execution.
> > I'm trying to bring the subshell to the foreground to perform an exit,
> after a delay.
> > Ultimately, it will be used as part of a terminal emulator inactivity
> timeout.
>
> Bash already has a TMOUT variable which will cause an interactive shell
> to exit after a specified length of inactivity.  Is that sufficient?
> If not, how does your desired solution need to differ from TMOUT?
>

i never heard of TMOUT before , too

>


Re: [PATCH] tests/array.tests: using grep -E instead of egrep

2024-02-19 Thread Robert Elz
Date:Mon, 19 Feb 2024 18:33:31 +0900
From:Koichi Murase 
Message-ID:  


  | GNU grep started to output error messages in v3.8 (2022-09) for egrep,
  | so the test failure will be happening in most GNU/Linux distributions
  | soon.

That (as in, gnu grep) should be fixed.  There's no reason not
to use grep -E on systems that have it, and similarly no reason
not to use egrep (or fgrep) on systems that have it (or them).

egrep is 2 chars less to type than grep -E, and does not involve
use of the shift key.  It is also traditional.  Issuing warnings
for using it is insane.

kre



Re: [PATCH] tests/array.tests: using grep -E instead of egrep

2024-02-19 Thread Oğuz
On Monday, February 19, 2024, Lawrence Velázquez  wrote:
>
> On what system does this happen?  The proposed changes might break the
> test suite on some older systems.
>

Agreed. Those egrep invocations can be replaced with `grep -v -e
BASH_VERSINFO -e PIPESTATUS -e GROUPS' though.


-- 
Oğuz


Re: [PATCH] tests/array.tests: using grep -E instead of egrep

2024-02-19 Thread Kerin Millar
On Mon, 19 Feb 2024, at 1:29 PM, Oğuz wrote:
> On Monday, February 19, 2024, Lawrence Velázquez  wrote:
>>
>> On what system does this happen?  The proposed changes might break the
>> test suite on some older systems.
>>
>
> Agreed. Those egrep invocations can be replaced with `grep -v -e
> BASH_VERSINFO -e PIPESTATUS -e GROUPS' though.

Indeed. This would be a perfectly sensible solution. For anything more 
involved, there is always awk.

-- 
Kerin Millar



Re: [PATCH] retry opening startup files on EINTR

2024-02-19 Thread Chet Ramey

On 2/7/24 1:33 AM, Grisha Levit wrote:

I have some dotfiles symlinked to storage backed by a macOS File
Provider extension (e.g. Dropbox):

 $ realpath ~/.bash_profile
 /Users/levit/Library/CloudStorage/Dropbox/profile/.bash_profile

This normally works fine, except when my terminal emulator (tested
both Terminal.app and iTerm) restores sessions after being restarted
-- opening the startup file fails in about half of the restored
sessions, which ends up looking like:

 [Restored Feb 7, 2024 at 00:11:37]
 Last login: Wed Feb  7 00:11:37 on ttys008
 Restored session: Wed Feb  7 00:11:27 EST 2024
 -bash: /Users/levit/.bash_profile: Interrupted system call
 mbp:~ levit$

If I remove ~/.bash_profile, and make ~/.inputrc and ~/.bash_history
similar symlinks, I see the same issue with loading them (without an
error message).

I'm not sure what the underlying cause is here, but maybe it would be
appropriate to retry open(2) calls for these files if they fail with
EINTR?


What's the underlying signal here? I hope it's not SIGINT.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRUc...@case.eduhttp://tiswww.cwru.edu/~chet/



OpenPGP_signature.asc
Description: OpenPGP digital signature


[PATCH v2] tests/array.tests: using grep -v -e instead of egrep

2024-02-19 Thread Xiangyu Chen
From: Xiangyu Chen 

The console ouput lots of egrep warning message, those message causes test case 
fail in diff stage.
According the message, using grep -v -e instead of egrep.

Warning message:
---
9d8
< egrep: warning: egrep is obsolescent; using grep -E
31d29
< egrep: warning: egrep is obsolescent; using grep -E
34d31
< egrep: warning: egrep is obsolescent; using grep -E
37d33
< egrep: warning: egrep is obsolescent; using grep -E
41d36
< egrep: warning: egrep is obsolescent; using grep -E
65d59
< egrep: warning: egrep is obsolescent; using grep -E
84d77
< egrep: warning: egrep is obsolescent; using grep -E
---

Signed-off-by: Xiangyu Chen 
---
[Change log]
v2->v1 according to the comments, using grep -v -e ... instead of grep -E to 
make sure
that it works on old version of gnu grep.
tested with manual, console log as below:

run-array
warning: all of these tests will fail if arrays have not
warning: been compiled into the shell
warning: the BASH_ARGC and BASH_ARGV tests will fail if debugging support
warning: has not been compiled into the shell
PASS: run-array

---
 tests/array.tests | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tests/array.tests b/tests/array.tests
index d0bb08b..07452ec 100644
--- a/tests/array.tests
+++ b/tests/array.tests
@@ -16,7 +16,7 @@
 set +o posix
 
 set +a
-# The calls to egrep -v are to filter out builtin array variables that are
+# The calls to grep -v -e are to filter out builtin array variables that are
 # automatically set and possibly contain values that vary.
 
 # first make sure we handle the basics
@@ -61,7 +61,7 @@ echo ${a[@]}
 echo ${a[*]}
 
 # this should print out values, too
-declare -a | egrep -v '(BASH_VERSINFO|PIPESTATUS|GROUPS)'
+declare -a | grep -v -e BASH_VERSINFO -e PIPESTATUS -e GROUPS
 
 unset a[7]
 echo ${a[*]}
@@ -92,11 +92,11 @@ echo ${a[@]}
 readonly a[5]
 readonly a
 # these two lines should output `declare' commands
-readonly -a | egrep -v '(BASH_VERSINFO|PIPESTATUS|GROUPS)'
-declare -ar | egrep -v '(BASH_VERSINFO|PIPESTATUS|GROUPS)'
+readonly -a | grep -v -e BASH_VERSINFO -e PIPESTATUS -e GROUPS
+declare -ar | grep -v -e BASH_VERSINFO -e PIPESTATUS -e GROUPS
 # this line should output `readonly' commands, even for arrays
 set -o posix
-readonly -a | egrep -v '(BASH_VERSINFO|PIPESTATUS|GROUPS)'
+readonly -a | grep -v -e BASH_VERSINFO -e PIPESTATUS -e GROUPS
 set +o posix
 
 declare -a d='([1]="" [2]="bdef" [5]="hello world" "test")'
@@ -111,7 +111,7 @@ b=([0]=this [1]=is [2]=a [3]=test [4]="$PS1" [5]=$pass)
 
 echo ${b[@]:2:3}
 
-declare -pa | egrep -v '(BASH_VERSINFO|PIPESTATUS|GROUPS)'
+declare -pa | grep -v -e BASH_VERSINFO -e PIPESTATUS -e GROUPS
 
 a[3]="this is a test"
 
@@ -129,7 +129,7 @@ d=([]=abcde [1]="test test" [*]=last [-65]=negative )
 unset d[12]
 unset e[*]
 
-declare -a | egrep -v '(BASH_VERSINFO|PIPESTATUS|GROUPS)'
+declare -a | grep -v -e BASH_VERSINFO -e PIPESTATUS -e GROUPS
 
 ps1='hello'
 unset ps1[2]
@@ -155,7 +155,7 @@ echo ${vv[0]} ${vv[3]}
 echo ${vv[@]}
 unset vv
 
-declare -a | egrep -v '(BASH_VERSINFO|PIPESTATUS|GROUPS)'
+declare -a | grep -v -e BASH_VERSINFO -e PIPESTATUS -e GROUPS
 
 export rv
 #set
-- 
2.35.5




Bug: Ligatures are removed as one character

2024-02-19 Thread Avid Seeker
When pressing backspace on Arabic ligatures (including characters with
diacritics), they are removed as if they are one character.

Example:

السَّلامُ

Pressing 3 backspaces leaves the word at ال. It removed لا which is a ligature
combining "ل" and "ا", and removed "م" with diacritics. Compare this with the
behavior of zsh.

For non-Arabic speakers, this is like typing: fi (U+0046 U+0049), but when
pressing backspace it removed it as the character: fi (U+FB01).