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

learn more… | top users | synonyms (1)

0
votes
0answers
6 views

How to create a module on a CentOS cluster

I would like to create a module on a CentOS 6 cluster (e.g. module load gcc-4.7.2). Are there any good tutorials illustrating this or could someone provide a "Hello World" type tutorial? I have ...
0
votes
0answers
36 views

Passing variables through <<EOF [on hold]

fdisk /dev/$ROOTDISK <<PARTCMD d $ROOTPARTNUM n p $ROOTPARTNUM PARTCMD How can i pass the $ROOTPARTNUM variable?
0
votes
0answers
17 views

Environment Variable not Exporting [duplicate]

I have this script that I'm writing, basically as my own free dynamic dns system (with a bit more manual-ness at the moment). Here it is: #!/bin/bash ...
0
votes
1answer
16 views

Pass environment variables to clean chroot in Arch

I am writing a PKGBUILD for Arch Linux. The package is large and compressing/uncompromising it take considerable time for limited space savings and I would like to turn it off while I am writing the ...
0
votes
0answers
27 views

How do I send a variable through SSH so it can be used across servers? C Shell

EDIT: Would this be possible in bash? Note: I have to use C shell. (.csh) I have something very similar to the following code: set var = "string" ssh -X server "$var" << END * I ...
0
votes
4answers
18 views

Unable to add folder to PATH in .profile file

The following is my .profile file: # ~/.profile: executed by the command interpreter for login shells. # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login # exists. # see ...
4
votes
2answers
75 views

Where is the `$TERM` environmental variable set in Debian Jessie for console logins?

I have read a lot of articles and SE questions regarding how and where the default $TERM environmental variable gets set. Unfortunately in Debian 8.1 I can't seem to find where the default $TERM ...
0
votes
2answers
29 views

How to pass an environment variable when change rooting?

I don't seem to be able to pass an environment variable to a chroot: $ sudo apt-get install debootstrap dchroot $ sudo debootstrap trusty mychroot $ sudo chroot mychroot /bin/bash -c "MY_VAR=5; echo ...
0
votes
1answer
70 views

Bash - check environment variables

The env command can be used to print environment variables in bash. I want to ask if there is any built-in command to do this ? $ export temp="hello world" $ env | grep temp The second command ...
2
votes
1answer
66 views

Bash - shell vs environment variable [duplicate]

I want to clarify a confusion I am having in shell variable vs environment variable. I did the following test, where I have a shell variable abc and export it to an environment variable. $ $ ...
1
vote
1answer
32 views

How set environment variable permanently in Red Hat Linux?

As I'm using Red Hat Linux 5.3, I'm unable to set environment variable permanently. I want the file names for csh, from which I can add the environment variables permanently.
-1
votes
1answer
37 views

How can I delay the evaluation of variables (lazy evaluation)?

For example, I create 32768 directories named 0,1,2,...32767. I want to randomly choose one as the path every time I run a command. So I change $PATH to $PATH:/blabla/$RANDOM, but it won't work ...
7
votes
1answer
590 views

Bash: How many nested sessions deep?

Say I start a bash shell, ...and then another bash session from within that shell, ...and then another bash session from within that session, ...and then another bash session from within that session, ...
2
votes
1answer
23 views

how to set Internal Variables in mailx in linux?

save internal variable enable saving of messages in the dead.letter file on interrupt or delivery error.The default is save. problem: default is save so dead.letter file is created at home directory, ...
1
vote
1answer
41 views

Get value of environment variable in for loop

I have several environment variable pam_branch app_branch worker_branch I use an array to define different projects and I want to get the values of these env var by rebuilding them in a for loop ...
43
votes
4answers
2k views

Is there ever a good reason to run sudo su?

To launch a root shell on machines where the root account is disabled, you can run one of: sudo -i : run an interactive login shell (reads /root/.bashrc and /root/.profile) sudo -s : run a non-login ...
0
votes
1answer
34 views

What is the perfect combination of Environment Variables for Tomcat? [closed]

I hosted one application UI in apache-tomcat server. I had set environment variables in bin/setenv.sh file as: CATALINA_OPTS="-server -Xms256m -Xmx512m -XX:PermSize=512m -XX:MaxPermSize=1024m ...
2
votes
1answer
100 views

Finding out what sh is [duplicate]

I am writing a set of scripts that I want to be portable, but I need to know whether sh on the current platform stands for bash, ksh, or ash. Is there a clear way to do it? What comes to my mind ...
2
votes
1answer
109 views

Why does bash parameter expansion not work inside systemd service files?

I am trying to use systemd's EnvironmentFile and add an option to the command when it is set in the file. I have the following in the unit file: ExecStart=/usr/bin/bash -c "echo ${PORT:+port is ...
0
votes
1answer
262 views

Set Environment variable $PATH globally on Ubuntu 14.04

I am trying to add evironment path variable of composer globally. I've tried many ways but doesnot seem to work. Searched other posts but did not find matching answers. I am trying to work out ...
0
votes
1answer
35 views

When I execute a .run file as <user> it works fine. If I sudo run it, it cannot detect Java

I am trying to execute a .run file that will install some applications. I'm installing the application in /opt/... When I run it without sudo, the installer runs correctly but cannot write to /opt/. ...
1
vote
6answers
95 views

How can I pass an environment variable to a script?

Okay, I can display an environmental variable from the commandline: echo $COLUMNS And get a response. But I can't execute that from within a shell script, I get nothing. So, there must be a way to ...
6
votes
1answer
64 views

Bash: How to avoid variable name substitution when using auto-completion?

I'd like Bash to stop removing variable names from paths and replacing them by their values. I tried several 'shopts' settings in various bash versions but was not successful in keeping a variable ...
2
votes
1answer
76 views

Updating environment variable in a shell script

I am trying to update the value of an environment variable in a third party shell script. My OS is Oracle Linux Server release 6.4 (Red Hat Enterprise Linux Server release 6.4 (Santiago). I already ...
1
vote
1answer
72 views

Configure tmux to use zsh

Right now I have my iTerm session configured to use zsh (/usr/local/bin/zsh), but I'm trying to configure tmux to use zsh as well, instead of /bin/bash/, which it's currently defaulting to. So far ...
3
votes
2answers
398 views

Where do EDITOR, PAGER, BROWSER environment variables come from?

When I look in man bash none of these are defined. However, random posts online refer to them; where do they come from? Or are they just a convention?
0
votes
1answer
18 views

OracleSolaris 11.2 - setting MANPATH variable

What is the right way to extend MANPATH in Solaris? Currently it is empty for a user session, so I get to do it manually in $HOME/.bash_profile: ...
3
votes
3answers
62 views

What's the 'right' format for the HTTP_PROXY environment variable? Caps or no caps?

I've encountered both http_proxy and HTTP_PROXY. Are both forms equivalent? Does one of them take precedence over the other?
1
vote
1answer
31 views

How to switch java environment for specific process?

I use openjdk in my work, but sometimes I need oracle's jre or even specific version of oracle's jre. As I know, I should update JAVA_HOME value and /usr/bin/java or /etc/alternatives/java link ...
0
votes
1answer
49 views

How to change JAVA_HOME temprorary with env command

I use openjdk for my work, but sometimes I need oracle's JRE. I thought that I could use 'env' command for this, but can't figure out why it's not working. I have openjdk in ...
1
vote
1answer
52 views

Magic environment variables in gnome-terminal

I had installed a proxy software (cntlm) on my machine. It sets the environment variable http_proxy to 127.0.0.1:3128. Now I've uninstalled the program using apt-get remove cntlm. However I'm able ...
1
vote
1answer
50 views

How to append to an environment variable using an .env file?

Assuming the .env file is loaded before execution, how can you append to it without overriding it? DEBUG=True FOO=BAR PYTHONPATH="/Users/James/project/" The above file would (?) override it, and ...
0
votes
2answers
45 views

Does kali distro not use /etc/environments file?

I appended a path to /etc/environments file and now it is like so: mindaugas@Kali:~$ cat /etc/environment | tr ":" "\n" PATH="/usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin /sbin" I ...
1
vote
1answer
49 views

How do I add an installed program to my PATH so I can run it from the command line?

I installed jsx using npm: npm install -g jsx Now it installed jsx in this path: /node_modules/lib/node_modules/jsx/bin In the bin, I'm having jsx. Now if type ./jsx, it works fine as expected. ...
1
vote
4answers
93 views

Is there a CLI tool that would prettify a JSON string [closed]

On my host I enter the following, which returns a bunch of information which isn't particularly easy to read at the CLI. echo $ENV_VAR | base64 --decode Is there a way to format it? This is a ...
2
votes
1answer
36 views

Unset all ENV variables matching _PROXY

I'm trying to unset all environment variables that match _PROXY: env | grep -i _proxy | column -t -s '=' | awk '{ print $1 }' | grep -iv 'no_proxy' | xargs -0 -I variable unset variable but it's ...
3
votes
1answer
150 views

what is the use of “export” command

I created a environment variable in one terminal window and tried to echo it in another terminal window. That displayed nothing. $TEST=hello After that I exported it and tried again to echo it in ...
1
vote
1answer
84 views

HOME is not set when exploiting a vulnerability

Can you help me solve this error? sh: line 61: cd: HOME not set. Distribution: Metasploitable 2 (Ubuntu 8.04) /root/.bashrc (comments and whitespace removed): [ -z "$PS1" ] && return ...
3
votes
3answers
237 views

How to set HOSTNAME in zsh?

In bash, which sets $HOSTNAME for you, I was able to calculate the total length of prompt line simply by using something like: PS1_length=$((${#USER}+${#HOSTNAME}+${#PWDNAME}+12+${#PS1_GIT})) It was ...
0
votes
0answers
24 views

Can I run a single program without running it through a window manager? (Gnome, Technic-Launcher)

I'm running into an issue with Technic-Launcher being completely white when run in gnome, but it's fine in other DE's. The developer says it's an issue with mutter and undecorated java windows. Can I ...
1
vote
1answer
27 views

How to correctly set the XDG base dirs gobally and dynamically

I get a lot of config folders in my homefolder. I assume that is, because $XDG_CONFIG_HOME is not set and some software (e.g. fontconfig, umlet) does not follow the standards. $XDG_CONFIG_HOME ...
2
votes
2answers
210 views

Zsh: export: not valid in this context

When running this script, I run into an error on this line (relevant snippet below): ... _NEW_PATH=$("$_THIS_DIR/conda" ..activate "$@") if (( $? == 0 )); then export PATH=$_NEW_PATH # If ...
15
votes
3answers
831 views

Issue an error when using empty shell variables

Sometimes I use, $PROJECT_HOME/* to delete all files in the project. When the environment variable, PROJECT_HOME is not set (because I did su and the new user doesn't have this environment variable ...
1
vote
0answers
28 views

If processes can't modify their parent's environment, what is MC doing?

As far as I know, a process cannot modify its parent's environment. However, when I run mc (GNU's Midnight Commander, a curses-based file manager) and then quit it, I end up with another $PWD: ...
0
votes
1answer
142 views

Fixing a broken PYTHONPATH environment variable

I recently installed some software, which required python to operate. For some reason, it installed its own version of python, and modified the PYTHONPATH variable. Now, when I attempt to import a ...
0
votes
0answers
30 views

Computer won't load if I comment out sourcing bashrc from .profile? [duplicate]

I am trying to understand the difference/application of system files like .profile/.bash_profile/.bashrc etc. Now, I understand that .profile will be sourced when I login to the computer routinely ...
0
votes
0answers
98 views

$PATH variable on Fish Shell OS X

I have somehow screwed up my path variables with Fish shell on OS X. Is this the proper $PATH variable in the config.fish? user@host ~> more ~/.config/fish/config.fish set -g -x PATH ...
5
votes
2answers
326 views

Can you execute a Bash function with the `at` command?

I want to execute a Bash function at a scheduled time. I think the right tool for this is the at command. However, it doesn't seem to be working. function stupid () { date } export -f stupid ...
3
votes
2answers
146 views

What is the difference if I start bash with “/bin/bash” or “/usr/bin/env bash”? [duplicate]

In shell scripts one specifies language interpreter on shebang(#!) line. As far as I know, it is recommended to use #!/usr/bin/env bash because env is always located in /usr/bin directory while ...
2
votes
1answer
88 views

How to safely transmit a password over SSH for a remote command to use

On the local server, I have a program that stores the password in the predefined environment variable (SPECIAL_PASSWORD). On the remote server I have a program that reads and uses a password from a ...