All Questions
31 questions
0
votes
0
answers
27
views
Terminal does not use .bashrc variables, but recognized them [duplicate]
I have installed the latest Pop!_OS version on my new computer and wanted to set the following environment variables:
CC=/usr/bin/clang
CXX=/usr/bin/clang++
CMAKE_GENERATOR=Ninja
Instead of typing ...
0
votes
1
answer
1k
views
Finding the address of an environment variable with and without GDB
I am trying to do an exploit, which spawns a shell, the shellcode is inside an environment variable and I launch the program or GDB with a clean environment so the variable is at the top.
env -i MYVAR=...
2
votes
2
answers
4k
views
How to access env variables defined in root from another user? [duplicate]
I have a env variable test defined in the user root. This can i access inside user root using command:
echo $test
Now i switch to another user myuser using su - myuser . Now How to access the test ...
0
votes
1
answer
148
views
Setting environmental variable in linux via ssh
I am working on three different issues so I have cloned source code in three different directories.
1) /nobackup/vivek/dev1/<source_code>..
2) /nobackup/vivek/dev2/<source_code>..
3) /...
2
votes
1
answer
2k
views
Why do I get this extra quote in an env variable defined in /etc/environment?
In our CentOS server, the env variable NODE_OPTIONS was set to a wrong value. I checked some possible files such as /etc/environment, /etc/profile, but no luck. I also tried to grep it from /etc/, ...
0
votes
1
answer
478
views
VISUAL and EDITOR variables aren't defined
I'm using CentOs 6 and learning about command line editing modes. The VISUAL and EDITOR variables aren't defined in my system and printenv or env commands don't show them. My X terminal starts in ...
0
votes
1
answer
794
views
crontab cannot find environment variable even after sourcing .bashrc
crontab -e
00 00 * * * /home/username/run.sh >> /home/username/log 2>&1
Inside run.sh:
source /home/username/.bashrc
java
When crontab job is triggered, I got this error in the log:
/...
2
votes
2
answers
2k
views
Export command not found in su - user
Starting with root, I want execute a sql script with another $USER. But I have to set the right $ORACLE_HOME and $PATH for $USER.
With this command I receive error export: command not found
su - $...
2
votes
1
answer
3k
views
How to view the binary contents of environment variables?
I'm practicing CTFs (capture-the-flag) and want to view the contents of an environment variable:
MyEnv=`python3 -c 'print(64*"A"+"\x0a\x09\x0a\x0d",end="")'`
Now, hexdump displays the following, when ...
2
votes
2
answers
4k
views
Where is the PATH variable set when I start a Bash shell with env -i bash?
I know that environment variables are set through reading or executing several configuration files, such as /etc/environment, /etc/profile, ~/.profile, ~/.bashrc, etc.
But when I was reading this ...
0
votes
2
answers
96
views
Add directory to all PATH-like variables [closed]
Is there a function that can add a root folder to all path-like variables? At the moment I use this function:
function prepend_paths() {
ROOT_PATH=$(readlink -f $1)
export PATH=$ROOT_PATH/bin:...
-1
votes
2
answers
9k
views
Why does sourcing a script in .profile not work?
I have an executable script which I want to run every time I log in or open a new interactive shell. I added the path to this executable in .profile and sourced it by adding this line to .profile
...
4
votes
1
answer
6k
views
Set environment variable for all login scenarios
I'm using Microsoft's dotnet in linux (ubuntu), and it has dial-home telemetry. I want to disable it, and the instructions say:
The .NET Core tools collect usage data in order to help us improve ...
0
votes
1
answer
1k
views
Unable to modify LD_CONFIG_PATH from script
I'm trying to write a script that adds some path to LD_CONFIG_PATH in order to not get "blabla.so not found". The problem is that my script is able to modify its own context (via export) but it doesn'...
1
vote
1
answer
6k
views
When root, source another user's ~/.bashrc and get all environment variables
I'm trying to develop a small system app that is run as root.
In this app, I would like to list all environment variables of the default user (not the $USER, but the user who calls runs the app as ...