Tag Info

New answers tagged

1

Please avoid modifing system files. Instead you should place an executable script in /etc/profile.d (scripts in here got executed for every user) to change $PATH value. /etc/profile.d/10-<package name>.sh #!/bin/sh export PATH=$PATH:/path/to/executable


2

Using find ${svn_root} -maxdepth 2 -type d -exec bash -c 'if svnlook info "$0" &>/dev/null ;then echo"$0" >> "$1" ;svnadmin verify "$0" 2>> "$1" ;fi' {} "$log_file" \; You need $0 and $1, because this is not a function or a script.


3

There are mainly two ways: Pass it as a second argument to the shell find ... -exec bash -c '...' _ {} "$log_file" \; And then you use "$2" instead of ${log_file} inside the script Pass it via the environment: log_file=$log_file find ... -exec bash -c '...' _ {} \; BTW, it's not a subshell.


1

You should be able to see such variables in your subshell if you used double quotes with bash -c "". A simpler method would be to just export the log_file variable in your main script as follow: export log_file Source: How to “send” variable to sub-shell?


3

Unless you explicitly created your user account with no home, all users should get a home directory. In terminal there's a variety you could access it. cd is one, cd ~ is one. Just to see the path to it, do cd; pwd, or echo ~, or echo $HOME, or awk -F ':' -v myusername=$(whoami) ' $0~myusername { print $6 }' /etc/passwd (this last one uses output of whoami ...


3

To print an environment variable you should use the $ sign before. So what you are doing in echo home this will just print the word home since the shell will not expand the variable home since it's not started with $ sign, and it should be capitalized. So to have the output you should run: echo $HOME To list all environment variables you can use the ...


7

TL;DR Variables in Linux start with the $. The command is echo $HOME If you type in printenv it will show you all the variables and what they equal. Or printenv | grep '^HOME='


2

This is because you have installed jayatana that enables global menu support for Java swing applications in Ubuntu. There are few ways of doing this: Option 1: Remove jayatana package sudo apt-get remove jayatana If you do not need global menu support for Java swing applications, you can simply remove the package. Removing the package will not cause more ...


2

There is no "global environment variable space". If you want to make your data persistent, then you need to store it in some file. Example: #!/bin/sh # Path to the persistent storage file file=~/name.txt # If the persistent file exists, use its contents as name if [ -e "$file" ]; then name=$(cat "$file") else # Use a default value otherwise ...


4

Two issues: You also need to export the variable into the environment as follows: export CATALINA_HOME=/opt/apache-tomcat-8.0.24 Since you are using /etc/profile, it won't take effect in X again, until you logout and in again of your xsession, not just your shell. Also sudo cannot find ./startup.sh. You need to be in the same directory as this ...


5

sudo ./startup.sh command will execute the startup.sh script in your current directory. This you should do: Add this line to /etc/profile for setting path while booting( Permanent change) export CATALINA_HOME=/opt/apache-tomcat-8.0.24 To set path temporarily execute above command in the current shell. and excute this: sudo ...


0

Your current "zsh terminal" has to be told to reread ~/.profile to see the changed contents. source ~/.profile should do the trick.


1

You have two options : You can use : export DISPLAY=:0.1 in the parent script. As we are using export the variable will be inherited by all child processes. You can use : DISPLAY=:0.1 in the child shell (if it calls further subshells use export in front). In this case as the child script is calling FFS just putting the DISPLAY in the child script ...


4

The variable $AMBERHOME contains an invalid folder name. Therefore the command cd can't work. Every time you run the command export AMBERHOME=$AMBERHOME/home/rcibsd/amber14, AMBERHOME will be set to the old value of AMBERHOME and the string /home/rcibsd/amber14 Example % FOO="/bar" % FOO="$FOO/bar" % FOO="$FOO/bar" % FOO="$FOO/bar" % echo $FOO ...


0

The problem turned out to be the SysV script /etc/init.d/elasticsearch itself. In the script the PID_DIR variable is set as : PID_DIR=/var/run/elasticsearch but there is no such directory exists and there is command to create it in the script too. The NAME and PID_FILE are set as: NAME=elasticsearch PID_FILE="$PID_DIR/$NAME.pid" So when the ...


0

As mentioned here EnvironmentVariables You can set system-wide environmental variables with three ways: /etc/environment /etc/profile /etc/profile.d/*.sh You could use for example /etc/profile. Execute this on your machine sudo echo "JAVA_HOME=/home/mockie/softwares/jdk1.8.0_45" >> /etc/profile


1

Add to the /etc/profile file(For system wide change) or to ~/.bash_profile( local user) export CATALINA_HOME=/opt/apache-tomcat-8.0.23



Top 50 recent answers are included