Tag Info

Hot answers tagged

18

It's an environment variable that is passed just to that program, rather than the shell as a whole. This happens when you set a variable on the same line as a command. X11 programs need to know where to display windows, since it's a client/server system and you could be displaying on a remote machine. This simply means use the first display on the local ...


17

zsh like most modern shells have a choice between two different keyboard mappings for command-line editing: a vi one and an emacs one. In some shells (like tcsh or readline-based ones like bash), the emacs one is the default and probably the one you expect. With zsh, you get emacs mode by default unless $EDITOR or $VISUAL contains vi (if you're a ...


7

DISPLAY=:0 gnome-panel is a shell command that runs the external command gnome-panel with the environment variable DISPLAY set to :0. The shell syntax VARIABLE=VALUE COMMAND sets the environment variable VARIABLE for the duration of the specified command only. It is roughly equivalent to (export VARIABLE=VALUE; exec COMMAND). The environment variable ...


5

Environment variables are stored in memory associated with a process. Every process has access to its own set of environment variables. A child process (one started by the "current" process) inherits a copy of those variables. It's not possible for any process to alter any other process's environment variables. Using a shell such as bash you can define ...


4

By strict interpretation what you want to do is impossible. So the question is how much do you have to cheat to pull something like this off? You need bash, a PROMPT_COMMAND and two temporary files. you will also have to accept that the shell will not be updated until the command after completion of the background task. I would also recommend using make in ...


2

Looks like your dollar sign in the 12th variable is in the wrong place. export TYPE_RELN_IDS="{$12}" should be export TYPE_RELN_IDS="${12}"


2

You need double quote in command substitution, otherwise, the shell will perform field splitting with the result of command substitution: $ env "$(echo 'VALUE="this is a test"')" ./somescript.sh "this is a test" For env reading from file, you must let the shell does field spliting, but set IFS to newline only, so your command won't break with space: $ ...


2

Yuch, too much maintenance and too much individual stuff. I'd recommend putting most of the effort into having appropriately scoped names that are appropriate for the platform so you can just have all of them all of the time. PYTHONPATH is a good example... you're unlikely to want to repurpose it for a Ruby project... You can group and mark the group with ...


2

The default PATH is set in /etc/profile. Users can modify their PATH by editing ~/.profile, ~/.bash_profile or ~/.bashrc (if they're running bash) but if they don't they will still have a PATH as defined in /etc/profile. That's why the line was PATH=$PATH:$HOME/bin and not just PATH=$HOME/bin That way, the original value of PATH is kept and the new ...


1

Yes and no (more yes than no, though). They are in your shell's memory, so not only do they go away when your current shell exits, they will not be there if you open a new shell anywhere other than your current shell.


1

Suppose the following bash : #!/bin/bash echo $# And you run such as : ./arg.sh g jt t uu It return 4, 4 is number of argument that you pass to your shell. It's very good to investigate your parameters of your shell script. Supppose i have the following usage of program : --value PATTERN -o PS_COMMAND_OPTIONS Then I can investigate such as the ...


1

Old question, but the cleanest solution for vim in zsh was to add the alias to ~/.zshenv, the file that zsh loads for all shells, login, interactive, or otherwise. This avoids starting vim or zsh with flags and any possible problems with that. There's a nice explanation of ~/.zshenv vs ~/.zshrc here: http://tanguy.ortolo.eu/blog/article25/shrc Basically, ...


1

It is an interesting exercise to write a bash function to remove a directory from a path variable. Here are some functions I use in my .bash* files to append/prepend directories to paths. They have the virtue of removing duplicate entries, if any, and work with any kind of colon separated path variable (PATH, MANPATH, INFOPATH, ...). the remove_from ...


1

Use export for environment variables. Environment variables are an operating system feature. Environment variables are inherited by child processes: if you set them in a shell, they're available in all the programs started by this shell. Variables used by many applications or by specific applications other than shells are environment variables. Here are a ...



Only top voted, non community-wiki answers of a minimum length are eligible