Tag Info

New answers tagged

0

For Plasma 5 it's ~/.config/plasma-workspace/env/


1

Yes. man su | sed '/^FILES/,/^$/!d' FILES /etc/pam.d/su default PAM configuration file /etc/pam.d/su-l PAM configuration file if --login is specified /etc/default/su command specific logindef config file /etc/login.defs global logindef config file There's no sudoers there. Maybe these files have been configured in a ...


7

To answer your question directly: no, there is no good reason to do this. Also, sudo su produces two log entries when one would suffice. I've seen many people do this, and when I ask why they don't just run sudo -s, the answer is just that they don't know about the -s flag to sudo, and generally they switch after I point it out. However, to your list of ...


19

As you stated in your question, the main difference is the environment. sudo su - vs. sudo -i In case of sudo su - it is a login shell, so /etc/profile, .profile and .bashrc are executed and you will find yourself in root's home directory with root's environment. sudo -i is nearly the same as sudo su - The -i (simulate initial login) option runs the shell ...


0

What are -Xms and -Xmx? Xms256m ---> Selects a low initial JVM heap size for an application. So, Xms specifies the amount of memory, in Megabytes, that will be used to start the server. Xmx512m ---> Selects the maximum JVM heap size permissible for an application. So, Xmx specifies the maximum amount of memory, in Megabytes, that will be ...


1

On popular distributions: $ which sh /bin/sh $ readlink -f /bin/sh /bin/dash Or more compact: $ readlink -f $(which sh) /bin/dash However, some (especially embedded systems or initrd builds) have their shell directly compiled as /bin/sh or it's a hardlink (busybox)


2

systemd does its own minipalistic shell-style command line parsing of the contents of ExecStart= and other parameters. This minimalistic parsing supports basic environment variable substitution but apparently not things like ${PORT:+port is $PORT}. You will want to prevent systemd from doing that and let the invoked shell handle it. From the documentation: ...


2

The following command export $PATH=somePath will return not a valid identifier and that is because of the $ before the PATH variable. solution: export PATH=somePath


1

You can change the settings in /etc/environment which contains a definiton of the $PATH variable, or add an entry to the system-wide bashrc ( /etc/bash.bashrc which is not as universal as changing the environment setting (i.e. only for bash and if the system-wide bashrc is actually loaded).


0

Run sudo visudo or alternatively open /etc/sudoers Check for the line secure_paths="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", If your Java is located somewhere else add that path to this list.


1

An environment variable is passed to a script. The problem is that COLUMNS is not an environment variable. From a script, you can call a command such as tput to retrieve the terminal dimensions. width=$(tput cols) </dev/zero head -c "$width" | tr '\0' '-'; echo (This script may not be portable beyond Linux.)


0

So, it appears that COLUMNS is not in env, so I guess the title of this thread is incorrect, as it's not an environment variable? export COLUMNS echo $COLUMNS Does not work. From the link I gather export is to make something available from the parent process to a child process, which is not what I want to do. Not sure what that suggestion was ...


0

You should do: COLUMNS=$COLUMNS my_script You could also do something like this rewrite in sed: STTY= for fd in 0 1 2 do [ -t "$fd" ] && break done|| ${STTY:?Run "$0" on a terminal} STTY=$( stty -a <&"$fd" | sed -Ee'/;/{s/^/;/' \ -e's/((; *[^ ;]* )[= ]*)?([^;])/\2\\\3/g' \ ...


1

This is a follow-on to your previous question and we're getting to what it is you want to do. I'm quite sure others have their own styles for this, but perhaps this will get you started. #!/bin/bash SCREEN_WIDTH=`stty size | awk '{print $2}'` echo $SCREEN_WIDTH That echo isn't what you are trying to do, just to demonstrate we've put the value somewhere ...


1

You might try to export COLUMNS See this for an explanation. But you should tell us how is the script called. If it is started by some crontab, it is likely to be executed in an environment without COLUMNS. You might use printenv to check.


0

Not an aswer to your question but... why don't you pass that as an argument to your script? your_scritp $COLUMNS while (( $# )) do echo -n "-" shift done echo EDIT: After reading Jason's answer, I checked COLUMS value (it is a single value), and in my case seen it is 80, then realize your for loop is wrong (my previous script was for a multivalue ...


1

I know I'm a little late to the party, but to undo exported environment variables, you can use the env command env -i zsh env runs the command given as an argument, and -i gives it a clean environment. Hope that helps someone!


5

Your /etc/bashrc sets PATH by interpreting $JAVA_HOME's value at that moment. It does not get re-interpreted if JAVA_HOME changes later. You'll want to add a line to the 3rd-party shell script that says: PATH=$JAVA_HOME:$PATH so that the 1.7 JAVA_HOME is put into the path before the /etc/bashrc's 1.8 JAVA_HOME.


1

You need to set default-command: set -g default-command /usr/local/bin/zsh default-shell variable only use to create a login shell, when default-command is empty - which is default value. Or you can simply change your default shell to zsh, in this case, tmux will start a login shell, instead of non-login shell.


7

They are just a convention as much as any other convention. EDITOR and PAGER are mentioned in the standards as belonging to variables you'd be unwise to conflict with since they are widely used. See Chapter 8, Section 1: It is unwise to conflict with certain variables that are frequently exported by widely used command interpreters and applications: ...


5

It is convention going as far back as I can remember, like 30+ years. The BSD 4.2 Manual page for mail of 1 April 1983 mentions EDITOR, SHELL, and VISUAL. PAGER isn't mentioned in BSD 4.2's verion of "man": If the standard output is a teletype, or if the flag - is given, man pipes its output through cat(1) But it is in in 4.3 Reno circa 1990. ...


0

http://docs.oracle.com/cd/E23824_01/html/E24456/userenv-1.html Looks like we don't really need MANPATH at all, simply adjust PATH and the man commands would do the rest.


2

There is no central authority who assigns an official meaning to environment variables before applications can use them. POSIX defines the meaning of some variables (PATH, TERM, …) and lists several more in a non-normative way as being in common use, all of them in uppercase. http_proxy and friends isn't one of them. Unlike basically all conventional ...


0

The convention is to use all capps environment variables when exporting them, so that when you are writing shell scripts you can use lowercase variable names without worrying about name collisions with other programs. Of course this is a convention only, there is no technical restriction on limiting the names of environment variables so the lowercase version ...


-1

Both http_proxy and HTTP_PROXY should work on RHEL and ubuntu based systems.



Top 50 recent answers are included