Re: Manipulating Environment Variables of an Already running process

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



W dniu 13 paÅdziernika 2010 23:23 uÅytkownik Hatem Nassrat
<hnassrat@xxxxxxxxx> napisaÅ:
> 2010/10/13 MichaÅ Nazarewicz <mina86@xxxxxxx>
>> 2010/10/12 Hatem Nassrat <hnassrat@xxxxxxxxx>:
>> > A usecase, changing the PS1 environement var of an already running
>> > bash process from another bash process.
>>
>> No. And even if it were possible you have no guarantees that the other
>> process will reread the environment variables.
>
> Well the use case I gave is one where the env var gets reread for each
> new prompt.

I wouldn't bet on it without looking at bash's code. Bash could just
copy PS1 to some
internal structures and read it rather than environment variable.

> Direct memory manipulation seems to be the only way I can think of,
> but I do not think this is possible in userland. I was thinking maybe
> there is a hidden sys call that might make this possible, like a very
> hacky and unstable IPC :), yeah there is no sane reason for such a
> feature but it would be cool to know if its at all possible.

No such thing. Process's memory is its own (unless process wants to share it).
--
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs


[Index of Archives]     [Audio]     [Hams]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Fedora Users]

  Powered by Linux