Tag Info

New answers tagged

2

If you insert echo "prevexit=3" > ~/.prevexit at the end of your crontab initiated command, then you can use: source ~/.prevexit close to the top of all the scripts that need to include the value, and use it in the rest of those scripts as $prevexit. You should of course replace 3 with the real value you want to share.


1

IFS=\;; set -- $IFS; echo $#; echo "$*" 1 ; IFS=; set -- $IFS; echo $#; echo "$*" 0 #there doesn't seem to be anything here As you can see - $IFS is not empty in the first case - it contains exactly one field separator. When the shell expands an unquoted variable it splits its value on the delimiters defined in $IFS. In this way each variable is, ...


1

In answer to why IFS is empty. It is not. But the value in IFS is changing the behaviour of the shell. Below is not an explanation but just the result of my experiments using bash on Debian Gnu+Linux. a=";"; echo $a produces ;. IFS=";"; echo $IFS produces blank line. IFS=";"; echo "$IFS" produces ;. Now a=";"; echo $a produces blank line, but IFS=" "; ...


1

If we type type read we get read is a shell builtin. Therefore it is not run as a sub-process.


5

Am I right that read first second is a subprocess of the current shell process? If yes, why don't we need export IFS=";"? No, read is a bash bultin function. No subshell or subprocess is created here, so we don't need to export IFS. why is IFS empty? Because you don't use double quote. You have changed value IFS to ;, so when you echo $IFS, ...


1

Environment variables are plenty secure. What the question you linked to is saying is that if the system is compromised, the only security benefit of using environment variables over a configuration file is obscurity. Meaning that if someone has gained root access, they can get to both. Whether using environment variables for secret data is considered ...


1

As Gilles explained in a very comprehensive answer to a similar question on security.stackexchange.com, process environments are only accessible to the user that owns the process (and root of course).


2

It's a bad idea if it doesn't work. I think your concern about profile.d not running unless someone logs in is legitimate. Put an init script in /etc/rc.d/init.d (I think this is the correct directory for Red Hat; in Ubuntu it's /etc/init.d) to start your daemon. In this script you can declare/define any variables you need and when you start the daemon ...


1

To directly answer your question, it's only a bad idea if it doesn't work. So my direct answer is "no", if it doesn't work, "yes" if it works. Did you try it? That is, have you confirmed that profile.d doesn't run on your system if no one logs in? As a suggestion of how to make it work: Edit the rc.local file in the same way, to ensure the settings are ...


1

You know how to set the variable in a shell, but for the record you can write: export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on' and all programs you start from this shell session after that will have the variable set. If you want it to be set for every shell you start afterwards, add that line to ~/.profile as well. In that case it will apply to ...


0

You set environment variables in a process and they are inherited by all the child processes. Exactly how you go about that depends on where you want it to be available. You don't have to modify any GLib configuration, though. To set an environment variable for programs started from your shell (I'll assume Bash here), you can write: export ...


0

As it states in the NGINX documentation: By default, nginx removes all environment variables inherited from its parent process except the TZ variable. The workaround to my specific problem can be achieved in a few different ways. Workaround 1: Append the PATH variable in Ruby By editing the config.ru file, we can simply define PATH if it isn't ...


1

In general linux sets the PATH environment variable by reading the dot files. When you login, /etc/profile is read. After setting default environment variables it reads .shell_profile which is for example .bash_profile. If this dot file does not exist then it tries to read .bash_login and if that doesn't exist either, it will look for .profile. Let's get ...



Top 50 recent answers are included