Tag Info

New answers tagged

0

Just put it somewhere inside the PKGBUILD but outside of prepare(), build() and package(). When done just remove it.


2

Your example wouldn't do anything if $HOME/bin doesn't exist. Maybe try this instead: # set PATH so it includes user's private bin if it exists if [ -d "$HOME/bin" ] ; then PATH="$HOME/bin:$PATH" fi PATH=/usr/local/MATLAB/R2015a/bin/:$PATH And, running ./matlab will never work (if matlab is not in the current directory) because you are trying to run ...


2

The main problem is that ./matlab runs the executable called matlab in the current directory. To look for it in $PATH, you need to type just matlab. The PATH variable is only used when there's no slash in the command name. Also, remove the export PATH=… line and instead add PATH=$PATH:/usr/local/MATLAB/R2015a/bin or ...


1

Try to type simply matlab and not ./matlab. The ./ means that you are looking for the executable matlab in the current directory without going through the PATH variable.


2

A reboot isn't necessary, but reloading your .profile is. Try running source .profile. Alternatively, you can log off and log on again.


0

Issue typeset +x variable_name... or declare +x variable_name... command. You can even use regular expressions for variable names, like typeset +x ${!MY_VAR_*}.


0

I use ranger too, and vim. Try export EDITOR=vim ranger then try out E option to open an editor for the file. If it worked, then the changes are not working for you for either of the two reasons. You forgot to source .bashrc after editing it with export EDITOR-vim change. You might be using another shell For scenario one, just do a source ~/.bashrc ...


0

Here's what I learned and how I resolved this seemingly common problem of GEM_HOME and GEM_PATH environment variables not set error. Background RVM install is supposed to create GEM_HOME and GEM_PATH env vars for each RVM that is setup and it does that. But there's a bug apparently such that in some cases the env vars are only set temporarily, and to set ...


0

According to this description, a systemd user instance does not inherit environment variables: https://wiki.archlinux.org/index.php/Systemd/User#Environment_variables There is a suggestion here to use oneshot systemd service that configures an EnvironmentFile for the "final" service. ...


5

I suppose TERM is set to linux for the init process (pid 1) by Linux kernel here and there. You can see it in /proc/1/environ (sorry the following output is from Ubuntu 15.04): $ sudo strings /proc/1/environ HOME=/ init=/sbin/init recovery= TERM=linux BOOT_IMAGE=/boot/vmlinuz-3.19.0-25-generic.efi.signed PATH=/sbin:/usr/sbin:/bin:/usr/bin PWD=/ ...


-1

The $TERM variable is normally set in /etc/profile or .bashrc depends on the distro ur using. Read http://www.tldp.org/HOWTO/Keyboard-and-Console-HOWTO-11.html


1

Use yaegashi's answer, or escape the $ like $ sudo chroot mychroot /bin/bash -c "MY_VAR=5; echo \${MY_VAR}"


2

Use single quotes: $ sudo chroot mychroot /bin/bash -c 'MY_VAR=5; echo ${MY_VAR}'


1

This gets what you're shooting for mostly working. example: $ at_path $HOME D<tab><tab> Desktop/ Documents/ Downloads/ Dropbox/ $ at_path $HOME Doc<tab> $ at_path $HOME Documents/<tab><tab> Documents/projects/ Documents/scripts/ Documents/utils/ Documents/clients/ $ at_path $HOME Documents/cli<tab> $ ...


1

You are right, when exporting or declaring a variable inside a shell, the variable is not added to the shell's environment (in the mean of updating the file - read below). You can view environment variables of the shell (or any other process) it had when it was invoked, by viewing the /proc/PID/environ file, where PID is the PID of the process you want to ...


2

Does export move the variable abc from shell to the environment OR does it create a copy in the environment and assign it a new value ? Neither. export simply marks a variable for export. When an external command is executed, the shell creates an environment to pass to it. Only variables marked for export are added to that environment. As man bash ...


0

This isn't a capability of any of the common shells. Recent versions of ATT ksh have a unique feature among shells called discipline functions. You can execute custom code when a variable is accessed, and if you set .sh.value to a different value, that value is used instead of the value of the variable. function PATH.get { .sh.value=$PATH:/blabla/$RANDOM; ...


1

For one user, add it to ~/.cshrc. To apply it to all users add it to /etc/csh.cshrc: setenv PATH /opt/something-special/ setenv VARNAME some_value


14

Use SHLVL. From man bash : SHLVL Incremented by one each time an instance of bash is started. Example : $ echo $SHLVL 1 $ bash $ echo $SHLVL 2 $ bash $ echo $SHLVL 3


1

The man page for my mailx says a lot of things about set nosave and so on, but they dont seem to work. The only way to stop your dead.letter file growing I have found is to replace it by a link to the special file /dev/null. rm ~/dead.letter ln -s /dev/null ~/dead.letter


1

Since there don't seem to be any environments where vi or similar would fail, I've taken to setting VISUAL to something that needs an X DISPLAY, and EDITOR to ex. Mostly, that just seems to cause me problems when some program doesn't use VISUAL.


-2

No. If logging is enabled for sudo, sudo -i FOO logs FOO (thus leaving an audit trace) while sudo su; FOO will only log the su but not the commands that follow it (like FOO). And of course the main difference is the use of passwords: sudo -i needs only the password of the user (if sudo is configured that way) while sudo su needs the password of root.



Top 50 recent answers are included