-1
votes
1answer
27 views

Using /usr/bin/env to change directory [closed]

I want to automatically execute commands with the prefix /usr/bin/env $/usr/bin/env composer install (this runs OK) $/usr/bin/env cd public (failed ---> /usr/bin/env: cd: No such file or ...
0
votes
3answers
152 views

How can I add a program path to the Windows environment variables for easy command line access?

Let's say I want to add the following path to the Windows environment variables: C:\Program Files (x86)\VideoLAN\VLC\vlc.exe Such that I can simply type the following from a command line without using ...
2
votes
1answer
145 views

What's the ZSH equivalent of BASH's $PROMPT_COMMAND?

BASH supports a $PROMPT_COMMAND environment variable that defines a command to be executed before any first-level interactive prompt. I'm looking for a ZSH equilvalent of that. The documentation says ...
0
votes
1answer
26 views

monit fails to support dbus session

I am trying to use monit to monitor and automatically issues like crashes, memory leaks and cpu hotspinning. For one application - one that uses DBus (serving and calling funcs) just will not start. ...
2
votes
2answers
75 views

env -i zsh | How is this magic possible?

I'm currently working, for school, on a home-made shell, therefore I'm kind of curious nowadays about how shell vars are set. Yes, this can be really exciting ! Anyway, we obviously have to deal with ...
0
votes
0answers
44 views

Ubuntu: `env -i bash --norc`, but include essential variables such as HOME, DISPLAY? (where are these set?)

Is there an easy way to isolate a session of bash so that only essential variables (HOME, USER, DISPLAY, etc.) are preserved? (essential in that many programs fail if HOME, DISPLAY, TERM, SHELL, etc. ...
0
votes
1answer
105 views

ZSH: Where to place environment variable so that launched application can pick it up?

I need an environment variable KEY="value" made available to a GUI application before starting it. The launcher file (the one that places the icon on the desktop and sidebar in Ubuntu) has a value of ...
0
votes
1answer
138 views

Understanding the scope and lifetime of environment variables in shell scripting

I'm pulling my hair out trying to understand shell scripting and passing environment variables, and what not. I'm trying to execute a PHP script from TextWrangler, that in it's turn opens a new PHP ...
1
vote
2answers
425 views

What is the difference betwen /etc/environment and /etc/profile?

I understand that the former is used prior to the latter, but what is the conceptual difference? Is there any good reasons I should set some variables in one and not in other? Except the fact that ...
0
votes
1answer
104 views

Environmental variables in login shells and interactive shells

I'm sort of confused of login shells and interactive shells. If I run ssh my_remote_server 'echo $HOME' I can get /home/shawk But when I run ssh my_remote_server 'echo $ANOTHER_VAR' I got a ...
0
votes
2answers
371 views

bash: variable name not being expanded with Tab completion

On a remote computer with bash version "3.2.51(1)-release" (OS: SUSE Linux Enterprise Server 11.1 (x86_64)), I could not do a usual tab completion with variable name. for example, I'd like to type: ...
0
votes
3answers
247 views

Is there any way to encapsulate bash functions?

I'm writing a simple script script.bash that is supposed to export some variables environment, to use it in my current session I have to source it $ . script.bash script.bash function fun1() { ...
1
vote
2answers
108 views

Where a bash variable (proxy) is defined

I have a problem with wget and I've discover that my proxy settings is wrong: $ env | grep "proxy" http_proxy=http://213.181.73.145:80 https_proxy=http://213.181.73.145:80 So, when I try to ...
2
votes
1answer
198 views

Echo string in tcsh with special characters escaped

Is it possible to echo out a string in tcsh such that it is fully escaped, as tcsh would understand? In the same way as printf %q works in bash: % # Create a variable containing a tab character % ...
1
vote
1answer
272 views

How to save environment variable on my Ubuntu Linux system

I am using Maven to the build process of my Java project. To launch the mvn command in any position within the shell I am using the following command to declare the environment variable in this way: ...
1
vote
1answer
232 views

$HOME environment variable edit

I have a question which might sound quite naive but I would like to confirm the behavior of the $HOME environment variable on the MAC OS X. I would like to know if we can append paths to the $HOME ...
1
vote
3answers
375 views

How to find out environment variables set after logging into a shell session

How can I find out the environment variables set after logging into a shell session? My two dummy solutions have been so far as follows: _VariableName1="VarValue1";export _VariableName1; ...
1
vote
1answer
207 views

How to set and print environment variable in Power Shell?

I work on Windows 7 and I wont to know how to set and print environment variable in Power Shell (for example $PATH)?
0
votes
1answer
748 views

Set vim's internal shell path

I'm trying to configure the $PATH env variable of vim's internal shell. I have commands that update the $PATH several times during a session. I see that vim inherits my shell's first $PATH - but not ...
0
votes
1answer
568 views

Environment Variables and Shell Rc File [duplicate]

Possible Duplicate: What are PATH and other environment variables, and how can I set or use them? I am trying to automatically establish a connection with Amazon s3 using keys. This ...
0
votes
2answers
362 views

Passing optional extra environment settings to the shell at Konsole launch time

I have a bunch of different "hats" on my computer, including multiple on-the-go projects (e.g., $work, a few projects on github, some on Sourceforge, some I'm involved with, some I just follow, etc.). ...
0
votes
1answer
40 views

How can you use the domain of the client connected over ssh in the shell?

Is it possible to get the users ip address, domain name, or host-name of an established ssh connection in the shell? For example, when I connect over ssh the first printed line says something like ...
0
votes
2answers
81 views

Is there a cursor-based interface to change environment variables?

I often need to change a small part of long environment variable (especially, e.g., paths), and do it either by pasting the thing into an editor and changing it there, or the equivalent. Is there ...
2
votes
1answer
288 views

What prompt is sh using when you type sh into Terminal?

When using the default PS1 prompt that MAC OS/Terminal comes with, when you type sh you get a new style prompt. station-4:~ user$ sh sh-3.2$ When you export your own PS1, this functionality goes ...
1
vote
1answer
233 views

Which linux environment varaiable gives the path to the users desktop?

It turns out that different languages can have a path to the desktop folder. ~/Desktop is ~/Työpöytä in Finnish What way via the shell can I get access to the translated folder?
0
votes
1answer
367 views

Locking Environment Variables

Is it possible to restrict the user from changing some set of environment variables? I have have a script that sets PATH to point at a specific build of some software, and puts the user in a new ...
1
vote
1answer
365 views

environment variable issue in shell

I am using Red Hat Linux Enterprise 5. I know the theory that -- using export to set environment variable, the environment variable will apply to current and child environment, but without using ...
6
votes
1answer
12k views

HOSTNAME environment variable on Linux

On my Linux box (Gentoo Linux 2.6.31 to be specific) I have noticed that the HOSTNAME environment variable is available in my shell, but not in scripts. For example, $ echo $HOSTNAME returns ...
0
votes
2answers
159 views

Existence of USER environment variable in the shell

I heard (although I can't find any sources for proof) that the USER environment variable may not be set in a old Unix shells (maybe even some obscure shells as well). What is the probability that it ...
1
vote
4answers
1k views

Shell environment for su

I have some aliases and modifications to ls that I'd like available at all times. Is it possible to set environment variables for use when I am logged in as root after I sudo up with sudo su?
4
votes
6answers
6k views

Why does my LD_LIBRARY_PATH get unset launching terminal?

I have a shell script to set up some environment variables and launch whatever program I send in as an argument: export PATH=$HOME/local/bin:$PATH export ...
23
votes
4answers
2k views

Difference between “a=b” and “export a=b” in bash

What's the difference between: a=b and export a=b In bash? I understand that they both define environment variables, but I don't fully understand the difference.