A set of dynamic variables that can affect the running processes.

learn more… | top users | synonyms (1)

1
vote
1answer
14 views

saving path on Debian

I add this to the end of ~/.profile PATH=/usr/local/texlive/2015/bin/x86_64-linux:$PATH export PATH but it is never saved. Close the terminal, open it again and the path is without the one to ...
1
vote
2answers
25 views

Setting path environment variable for desktop launchers [duplicate]

I set a custom $PATH in ~/.bashrc with PATH=$HOME/.bin:$PATH. When I launch the geany from the terminal it is able to find my custom build tools that are located in $HOME/.bin. When I launch Geany ...
2
votes
1answer
30 views

Can I use an environment variable to define an alias?

I'm using an automation engine to run perl scripts. script_X requires a wrapper script so it's run like: wrapper_script script_X --parameters But the automation engine can't understand that ...
0
votes
0answers
9 views

Tomcat variables in jcrontab.properties [migrated]

I have a Tomcat7 and java webbapp with jcrontab. Can I use $CATALINA_BASE variable in jcrontab.properties? For example: ...
1
vote
1answer
34 views

timestamping history file causing erroneous lines in history command

I have .bash_profile setup to export to a history file: export HISTFILE=/root/history/.bash_hist-$(who -m | awk '{print $1}') Then I am exporting time stamps for the history command. export ...
1
vote
1answer
30 views

export (save) and import (source) shell variables

I need to save environment variables to a file and (later) a process should import them. I need this to workaround a program fooprog that nullifies the environment before executing a barscript, and I ...
-1
votes
1answer
59 views

Where do C# executables running on an Ubuntu Linux 16.04 desktop which use source code that DLLImport's shared objects look for them at runtime? [closed]

Where do C# executables running on an Ubuntu Linux 16.04 Lenovo Thinkstation desktop which use source code that DLLImport's shared objects (so's) look for shared objects at runtime? Even if the shared ...
0
votes
1answer
33 views

Is using env and export the same thing?

I'm wondering whether this (From https://www.digitalocean.com/community/tutorials/how-to-read-and-set-environmental-and-shell-variables-on-a-linux-vps): env VAR1="blahblah" command_to_run ...
1
vote
0answers
24 views

no names in kali linux [on hold]

I am running kali linux, which has gnome. I just updated with: apt-get update && apt-get upgrade that what happen apt-get update && apt-get upgrade
3
votes
2answers
51 views

How to export a variable from a perl script into a shell script?

I have a shell script in which I am running perl script by below code. perl perlscript.pl In the perl script I have defined a variable called $circle. Now I want to use this variable value in my ...
4
votes
2answers
357 views

SH: How to make vars from one script available in the main script?

I have two scripts that need to run and both require the same variables set the same way. As a result I figured I'd break the setting of the variables out into a separate script. However, I can't seem ...
4
votes
3answers
492 views

Is there a Unix equivalent of the Windows environment variable PATHEXT

I am wondering if there is a Unix equivalent for the Windows environment variable PATHEXT. For those with no Windows background: Adding a file suffix to PATHEXT allows me to execute a script without ...
1
vote
1answer
37 views

cannot get screen command to execute code containing DISPLAY=:0

I am trying to ssh into a remote machine and run a shell script, which opens a GUI. I want the GUI to open on the remote machine and remain open (so I am using DISPLAY=:0 nohup). I tried: ssh -t ...
1
vote
2answers
60 views

Why does environment variables persistance breaks the PATH var

I tried to persist the environment variables for ORACLE in RedHat using /etc/environment It cleared my PATH variable, no command was recognized afterwards. Why does it happen, since just ...
3
votes
1answer
32 views

How to temporarily change locale for sudo?

To change the locale of the current user like export LANG=en_US.UTF-8. But this environment variable doesn't affect the root user. When I use sudo the display language remains default. How can I ...
1
vote
2answers
44 views

What sets the $SHELL environment variable?

Where is the environment variable $SHELL first set on a UNIX system? How can I find and print all of this type of default settings of my terminal?
1
vote
1answer
28 views

Where are the places the PROMPT_COMMAND variable could be set?

I installed drush and as part of the installation it makes some changes to the PROMPT ... # Optional. Enrich the bash startup file with completion and aliases. drush init ... Whenever I execute an ...
2
votes
1answer
29 views

Exporting a variable so it appears in a script sourced through sudo

I have a bash script/s which has a "main" script which is run as sudo. Variables are declared in this script. Then it sources another commands.sh script, however this script uses sudo to drop back to ...
1
vote
1answer
25 views

Pass Environment Variable to Sudo AWS ec2 sudo node

I am new to linux and AWS. I have a node.js server running on an EC2 instance. I am running the following command to keep it running endlessly and on port 80: $ sudo node app.js & Now when I ...
0
votes
2answers
58 views

How to properly set environment variables in Debian Jessie?

I can't figure out how to set environment variables properly, even though I tried to follow https://wiki.debian.org/EnvironmentVariables. I've added this to ~/.bashrc: if [ -f ~/.bash_profile ]; ...
3
votes
1answer
46 views

Can't export environment variables on X session start

My setup is: Debian testing (stretch), up to date LightDM with autologin enabled Awesome window manager bash, in ROXTerm or XTerm I don't seem to be able to set own environment variables and get ...
0
votes
1answer
44 views

“export VAR=thing && someCommand” reports “export: `&&': not a valid identifier”

I'm trying to set an environment variable and execute a command in a single line, like this: export PUB_CACHE=/app/src/.pub-cache && dart-sdk/bin/dart server.dart (Don't ask why... it's ...
0
votes
2answers
49 views

Get the latest value of an environment variable is a bash shell script

I wonder how can we get the latest value of an environment variable in a bash shell script. Problem I am having is, I have a environment variable which can be changed externally multiple times. But ...
0
votes
0answers
19 views

How to make cron job which suspends computer before specified time of the day

I am trying to make script which suspends computer if it is used before specified time of the day or if it is used too long. #! /bin/bash ...
0
votes
2answers
7 views

How can i get an overview about env (environment variables) of all users on a system?

How can i get an overview about env (environment) of all users on a system? Status: i've got over 600 user in passwd, but each of them could have a env variable for a specifec project path (~10 ...
0
votes
2answers
47 views

Systemd bash builtins

I have an application that needs to use the commando source for setting his environment file. [Unit] Description=Programname After=syslog.target network.target [Service] User=root ...
0
votes
0answers
31 views

Environment Modules: installing software

I understand how Environment Modules work, having used them before. I have read the various help pages, and I understand how to write a module file. My question is explicitly about the various ...
0
votes
1answer
30 views

Using export USER=myName doesn't change the output of whoami

I saw this example $ whoami MatsP $ g++ -Wall -std=c++0x getenv.cpp $ ./a.out MatsP $ export USER=DonaldDuck $ ./a.out DonaldDuck but for me it doesn't work. I am in a Debian machine. I used ...
1
vote
2answers
80 views

An environment variable with equal sign and && operator

I want to create an environment variable for this command: git --git-dir= echo test-folder/.git/ add Steps-to-follow.txt && git --git-dir= echo test-folder/.git/ commit This is a relevant ...
1
vote
1answer
38 views

how to get or reflect the name of the bash function which is called? [duplicate]

i did not yet found a solution to this. Anyone a hint? i sometimes write bash functions in my shell scripts and i love to have my scripts being verbose, not just for debugging. so sometimes i would ...
0
votes
1answer
26 views

Substitute variable in value of chpst loaded environment variable

If I use chpst to load environment variables like: env BAR=baz chpst -e envdir mycommand and in envdir I have a file envdir/FOO with contents foo$BAR is there a way so that for mycommand the ...
2
votes
2answers
61 views

Updating shell functions and aliases through environment variables

Say we define the following shell function and alias in .zshenv: export VARIABLE_A='original' function my_function() { print $VARIABLE_A } export VARIABLE_B='original' alias my_alias="print ...
0
votes
1answer
44 views

How to set multiple env variables from stdout pipe

I have a bunch of piped shell commands that give some env output. I want to set these as env variables for an additional command to add to the chain Kevins-MBP:ops kevzettler$ eb printenv | tail -n ...
1
vote
1answer
26 views

Which shells have functions where “local” does not alter exported variables for child processes?

In the example below, an exported variable is re-set as local in a function. Bash, Zsh, Fish don't pass on the original value to the child process. Are there any shells that make local affect the ...
2
votes
3answers
129 views

Bash one-liner to temporarily append path for chained commands without additional bash invocation?

Consider this: $ cd /tmp $ echo "echo YES" >> prog/myprog $ chmod +x prog/myprog $ prog/myprog YES $ myprog myprog: command not found I can temporarily modify PATH to call myprog by name like ...
0
votes
1answer
41 views

.zshenv not sourced on ssh login?

According to the docs .zshenv is sourced on all invocations of the shell, unless the -f option is set. It should contain commands to set the command search path, plus other important environment ...
1
vote
2answers
67 views

Why some commands don't load user environment when executed with ssh? (while other do)

On a target machine (OS X El Capitan) I have brew in /usr/local/bin. When I try to get brew's path I get no result: # ssh vagrant@127.0.0.1 -p 2222 which brew # Troubleshooting: brew is in ...
1
vote
1answer
23 views

How can I set kerberos principal in environment automatically on the remote host?

I use both legacy krsh and ssh to login to a variety of boxes for root administration, as do several colleagues of mine. We all keep different history files by use of a variable calculated by running ...
1
vote
1answer
65 views

What is the LESS environment variable to man and how is it set up?

What is the LESS environment variable used for in man? I found that it could make the output of man jump to a match to the pattern stored in LESS. What about when there are several matches? How is ...
3
votes
1answer
75 views

how to: Please sudo, do _not_ setup any environment, especially $SUDO_USER?

I want to start a process as another uid and it should not need any information from $(env), so I strip the environment prior to the sudo -u powerlessuser /bin/processCmd, that is I run this env -i ...
3
votes
1answer
63 views

Difference between logname and $LOGNAME

While reading about environment variables, the one I came across was LOGNAME, I'd like to know the difference between this variable and whatever the command logname returns - as both of them did ...
2
votes
3answers
104 views

Trying to understand .bashrc, env, and export

Disclaimer: Using bash. I just need some confirmation / correction on my understanding of these things: env is basically displaying the current environmental variables that are accessible to my ...
0
votes
1answer
28 views

Make exported path effective immediately?

I'm using a script to export a path like this: echo "export MONO_PATH=~/turbo/" >> ~/.profile; So from now on, the path will be available whenever the user logs in. However, I want to the ...
2
votes
1answer
108 views

Set environment variable (TZ) for all startup scripts and inittab

I'm working on an embedded Linux system and looking for a way to set the time zone for all processes. The question is: Is there any possibility to set the TZ environment variable at boot time (init ...
2
votes
2answers
52 views

How to store the printout of the last command in a shell variable in urxvt/zsh?

I'd like to have the printout (stdout and stderr) of the last command run within zsh available in a variable ready to use grep, etc on it.
0
votes
1answer
22 views

Conditionally command line export variable

If I run export COMMAND=nonexistentcommand && which $COMMAND >/dev/null || \ (echo "download filewithcommand.sh" && export COMMAND=./filewithcommand.sh) echo "command: $COMMAND" ...
2
votes
2answers
27 views

Why some scripts use export for system variables? [duplicate]

I see many online tutorials for ubuntu, and some of them are using export= in the beginning of the script for system variables. for example: export JAVA_HOME=/usr/local/java/jdk1.8.0_05 export ...
5
votes
3answers
133 views

bash script's temporary value on command

Like below command, if true; then IFS=":" read a b c d e f <<< "$test" The book says when value assignment command (IFS ":") is used before main command(read a b c d e f <<< ...
0
votes
1answer
53 views

env -i and bash-c

Can someone please help me understand the difference between bash -c 'echo $SHELL $HOME $USER' and env -i bash -c 'echo $SHELL $HOME $USER' I tried going over it many times but I still don't get ...
3
votes
1answer
121 views

Bash script can't locate perl module

I have a shell script which isn't running menutray on i3 startup. Line in .i3/config: exec ~/.i3/i3-scripts/menutray.sh This is what I tried for debugging: #!/bin/bash menutray -i -u -r ...