Re: add custom environment variable in bash source code

2022-08-17 Thread Alex fxmbsw7 Ratchev
On Thu, Aug 18, 2022, 04:10 Dale R. Worley wrote: > Sam writes: > > You probably want to edit /etc/ld.so.conf or /etc/ld.so.conf.d/* instead. > > The overall concept is that you almost certainly don't want to modify > the bash source code (and thus executable) to do this. > > In general, if you

Re: add custom environment variable in bash source code

2022-08-17 Thread Dale R. Worley
Sam writes: > You probably want to edit /etc/ld.so.conf or /etc/ld.so.conf.d/* instead. The overall concept is that you almost certainly don't want to modify the bash source code (and thus executable) to do this. In general, if you want to have a particular environment variable set "all the time

Re: add custom environment variable in bash source code

2022-08-17 Thread Ángel
On 2022-08-17 at 10:09 +0800, b1431736...@163.com wrote: > excuse me, how can I join the custom environment variable > into the source code of Bash, and see this variable when execute env You probably need to export the variable in .bash_profile or .bashrc files. As Chet said, there would

Re: add custom environment variable in bash source code

2022-08-17 Thread Sam
> On 18 Aug 2022, at 00:19, b1431736...@163.com wrote: > > Because I'm using Android, Android doesn't support #!/bin/sh and #!/bin/bash, > there is a dynamic library that fixes it, so I want to automatically add > LD_PRELOAD before starting bash to make this dynamic library work , I want to >

Re: Re: Re: add custom environment variable in bash source code

2022-08-17 Thread Alex fxmbsw7 Ratchev
no .. i say im not good at .c yet On Thu, Aug 18, 2022, 01:36 wrote: > Sorry, I don't understand what you want me, you can send a .diff file > tells me how to do? > > 在 2022-08-18 07:26:45,"Alex fxmbsw7 Ratchev" 写道: > > > > > On Thu, Aug 18, 2022, 01:19 wrote: > > Because I'm using Android, An

Re:Re: Re: add custom environment variable in bash source code

2022-08-17 Thread b1431736437
Sorry, I don't understand what you want me, you can send a .diff file tells me how to do? 在 2022-08-18 07:26:45,"Alex fxmbsw7 Ratchev" 写道: On Thu, Aug 18, 2022, 01:19 wrote: Because I'm using Android, Android doesn't support #!/bin/sh and #!/bin/bash, there is a dynamic library that fixes

Re: Re: add custom environment variable in bash source code

2022-08-17 Thread Alex fxmbsw7 Ratchev
( or use the eval function ( dunno its name and usage ) and eval your two var assignments ) On Thu, Aug 18, 2022, 01:26 Alex fxmbsw7 Ratchev wrote: > > > On Thu, Aug 18, 2022, 01:19 wrote: > >> >> Because I'm using Android, Android doesn't support #!/bin/sh and >> #!/bin/bash, there is a dynam

Re: Re: add custom environment variable in bash source code

2022-08-17 Thread Alex fxmbsw7 Ratchev
On Thu, Aug 18, 2022, 01:19 wrote: > > Because I'm using Android, Android doesn't support #!/bin/sh and #!/bin/bash, > there is a dynamic library that fixes it, so I want to automatically add > LD_PRELOAD before starting bash to make this dynamic library work , I want to > modify the source co

Re:Re: add custom environment variable in bash source code

2022-08-17 Thread b1431736437
Because I'm using Android, Android doesn't support #!/bin/sh and #!/bin/bash, there is a dynamic library that fixes it, so I want to automatically add LD_PRELOAD before starting bash to make this dynamic library[https://github.com/termux/termux-exec] work , I want to modify the source code of bash 

Re:Re: add custom environment variable in bash source code

2022-08-17 Thread b1431736437
Because I'm using Android, Android doesn't support #!/bin/sh and #!/bin/bash, there is a dynamic library that fixes it, so I want to automatically add LD_PRELOAD before starting bash to make this dynamic library work , I want to modify the source code of bash to make it effective, not the bash.b

Re: add custom environment variable in bash source code

2022-08-17 Thread Alex fxmbsw7 Ratchev
maybe just 'eval "declare -gx var=value"' in bash.c code On Wed, Aug 17, 2022, 17:53 Chet Ramey wrote: > On 8/16/22 10:09 PM, b1431736...@163.com wrote: > > > Bash Version: 5.1 > > Patch Level: 16 > > Release Status: release > > > > Description: > > excuse me, how can I join the custom

Re: [PATCH] fix build with --disable-array-vars

2022-08-17 Thread Chet Ramey
On 8/17/22 11:30 AM, Emanuele Torre wrote: --- execute_cmd.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) Thanks for the report. This doesn't come up in a minimal build because it's inside the conditional command code, which is not enabled in a minimal config. -- ``The lyf

Re: add custom environment variable in bash source code

2022-08-17 Thread Chet Ramey
On 8/16/22 10:09 PM, b1431736...@163.com wrote: Bash Version: 5.1 Patch Level: 16 Release Status: release Description: excuse me, how can I join the custom environment variable into the source code of Bash, and see this variable when execute env What is it you want to do? You rarely

[PATCH] fix build with --disable-array-vars

2022-08-17 Thread Emanuele Torre
--- execute_cmd.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/execute_cmd.c b/execute_cmd.c index d0d1dd31..4d0fdcf7 100644 --- a/execute_cmd.c +++ b/execute_cmd.c @@ -3901,7 +3901,10 @@ execute_cond_node (cond) } else if (cond->type == COND_UNARY) { -

add custom environment variable in bash source code

2022-08-17 Thread b1431736437
Configuration Information: ./configure --prefix=/data/data/com.termux/files/usr Machine: aarch64 OS: linux-gnu Compiler: clang Compilation CFLAGS: -g -O2 -Wno-parentheses -Wno-format-security uname output: Linux localhost 3.18.71-perf #1 SMP PREEMPT Wed Jul 27 22:01:17 CST 2022 aarch64 Android Mac

Re: [PATCH] fix read uninitialized at exec_builtin:orig_job_control

2022-08-17 Thread Chet Ramey
On 8/16/22 1:58 PM, Xiami wrote: The following script will likely failed to echo "Failed to exec" in non-interactive mode: #ls -l /proc/$$/fd shopt -s execfail exec notexistexecutable echo >&2 "Failed to exec" #ls -l /proc/$$/fd exec_builtin will `goto failed_exec` afte