Tag Info

New answers tagged

0

PATH is usually set up in ${HOME}/.bashrc, the file yousource`d. To see which line, you could type: grep -n virtualenvwrapper ${HOME}/.bashrc Redo the step of the "tutorial for this on Ubuntu" (no actual link, and why should I go read it anyhow?) that had you entering the PATH, or edit ${HOME}/.bashrc yourself.


0

If using the bash shell, add to your .bash_profile: mycd(){ builtin cd "$@" case $PWD in */proj1*) export JAVA_HOME=/a ;; */proj2*) export JAVA_HOME=/b ;; esac } alias cd=mycd Then when you type cd ... it will run mycd in which you can do stuff. It starts by calling the real built-in cd. You need to start a new ...


1

The /etc/environment update will only work on the next session, it's not automatically reloaded. Which means you cannot change it for sessions that have already started for other users. If you want to "reload" whatever is in the /etc/environment you need the following command: source /etc/environment But again it will only work for your own current ...


0

I suspect that only one line is present in /etc/environment file. Open the file /etc/environment in an editor sudo nano /etc/environment And check the double quote at the end of the line. Compare the content with the line below, note the double quote at end of the line. ...


0

The problem was all about the unneeded symbolic link. sudo ln -sf /usr/share/postgresql-common/pg_wrapper /usr/local/bin/pgsql2shp I fixed the issue finally by just removing the symbolic links. sudo rm /usr/local/bin/shp2pgsql sudo rm /usr/local/bin/pgsql2shp sudo rm /usr/local/bin/raster2pgsql Then removed postgis 2.1 with sudo apt-get remove ...


1

Create a script with the name export_flags #!/bin/bash srt_file_name="${1%\.*}".srt if [ -f "$srt_file_name" ]; then FLAGS="-i $srt_file_name -sub_charenc CP1252 -vcodec copy -acodec copy" else FLAGS="" fi export FLAGS="$FLAGS" Make it executable chmod +x export_flags Start a test with source export_flags your_mkv echo $FLAGS E.G. ...


5

Here is another idea using awk arp -ni eth0 | awk 'NR>1 {print $1}' Example $ arp -ni eth0 | awk 'NR>1 {print $1}' 192.168.20.3 192.168.20.1 192.168.20.11 or with a variable $ addresses=$(arp -ni eth0 | awk 'NR>1 {print $1}') $ echo $addresses 192.168.20.3 192.168.20.1 192.168.20.11 To get a specific index without an array $ arp -ni eth0 ...


5

arp manipulates the entries in the kernel ARP cache, you are probably going to get a lot of entries (depends on the size of the LAN). As you are only interested in the IP addresses you should use the -n option so that arp shows numeric addresses instead of hostnames first. Also you will typically get a lot of IP addresses depending the size of your LAN, so ...


1

In bash you can set variables like this: export JAVA_HOME=/usr/lib/jvm/java-8-oracle/​ export CLASSPATH=JAVA_HOME/lib/:$CLASSPATH export PATH=$JAVA_HOME/bin/:$PATH export M2_HOME=/usr/share/maven/ export M2=$M2_HOME/bin export PATH=$M2:$PATH for more info on environment variables you can read https://help.ubuntu.com/community/EnvironmentVariables


0

At EnvironmentVariables, ~/.pam_environment and ~/.profile are mentioned as suitable files in Ubuntu. Personally I prefer ~/.profile since it's a script file.


3

When you run a command in bash via -c option, a non-interactive shell is spawned. The ~/.bashrc file is sourced for non-login interactive shells (and also for login interactive shells, sourced from ~/.profile). The main point is interactivity. The ~/.bashrc file has the following snippet at the start : case $- in *i*) ;; *) return;; esac This ...


2

Actually all these PPAs are from third parties. Oracle does not provide any PPA, and the manual way of installing Oracle JDK 8 is explained in step by step manner in this article : Install Latest Oracle JDK in Ubuntu Step 1: Download the latest JDK(jdk-Xuxx-linux-xXX.tar.gz) from this official link. Step 2: Open the terminal (Ctrl + Alt + T) and enter the ...



Top 50 recent answers are included