Via gdb:
(gdb) attach process_id
(gdb) call putenv ("env_var_name=env_var_value")
(gdb) detach
This is quite a nasty hack and should only be done in the context of a debugging scenario, of course.
More Related Contents:
- Difference between shell and environment variables
- Where can I set environment variables that crontab will use?
- How to pass command output as multiple arguments to another command
- Environment variable substitution in sed
- What does “&” at the end of a linux command mean?
- Aborting a shell script if any command returns a non-zero value
- Better way to rename files based on multiple patterns
- Linux: copy and create destination dir if it does not exist
- What is the difference between using `sh` and `source`?
- Setting environment variables in Linux using Bash
- What is the difference between “#!/usr/bin/env bash” and “#!/usr/bin/bash”?
- Does “argument list too long” restriction apply to shell builtins?
- Given two directory trees, how can I find out which files differ by content? [closed]
- How to sort a file in-place?
- Is it OK to use the same input file as output of a piped command?
- Finding contents of one file in another file
- When to wrap quotes around a shell variable?
- What is the maximum size of a Linux environment variable value?
- How do you normalize a file path in Bash?
- How to compare two DateTime strings and return difference in hours? (bash shell)
- Linux/Unix command to determine if process is running?
- How can I copy the output of a command directly into my clipboard?
- Using grep and sed to find and replace a string
- Running shell script in parallel
- What’s the point of eval/bash -c as opposed to just evaluating a variable?
- How to attach a file using mail command on Linux? [duplicate]
- Syntax error near unexpected token ‘then’
- Why doesn’t “sort file1 > file1” work?
- Need to remove the count from the output when using “uniq -c” command
- How do you run a script on login in *nix?