Skip to content
Advertisement

Tag: path

Why copy command is not working when using file paths?

I’m having a problem with the copy command. cp ../teste/env/test/x.tar ../../../teste2/file The folders exist and also the file x.tar. When I start the script I’m on a different folder, so that’s why I make a ../ at the begining. It keeps giving me this error: cp: cannot create regular file ‘../../../teste2/file’: No such file or directory Worth to note that

Why is subprocess ignoring PATH, and how can I change this?

I need to change which program is called by a Python application. Unfortunately I cannot change the Python code. I can only change the calling environment (in particular, PATH). But unfortunately Python’s subprocess module seems to ignore PATH (at least under certain circumstances). How can I force Python to respect PATH when searching which binary to invoke? To illustrate the

How to make command “Hadoop” work in linux 18.04?

I installed Hadoop and now it works with command /usr/local/hadoop/bin/hadoop. Where and how should I add this path to make command hadoop work without a full path to file? I already tried .bashrc and /etc/environment, but it didn’t help. Answer You need to add it to your PATH environment variable. PATH is used to find programs to run in the

Remove part of a string by using bash

I have the path /home/bamboo/bamboo-agent-home/xml-data/build-dir/NG-VOSGQL239-JOB1 and would like to get just /home/bamboo/bamboo-agent-home/xml-data/build-dir/ How can I delete the last part of the path if it can be with different lengths by using Bash? Answer Using bash regex =~:

How to set PATH in Ubuntu 17.10 for custom path

I made a folder called bin in /home/USER/bin on this, I created a file called hello ( for example) with this code: I did execute export PATH=$PATH”:$HOME/bin” and then $ . ~/.bashrc, but when I restarted the PATH is restored to default. How can I resolve it? Thank you! Answer The user bin directory should already be added to your

Non-dash related bad substitution error

I am trying to write a bash script performing to find and pull somewhere else a specific file type. So far, I came up with the following script: find ./to_compress -type f -iname “*.tar” -mindepth 1 -maxdepth 1 -exec mv {} ./compressed/${{}##*/} However the bash complains that ${{}##*/} is a bad substitution bash: ./compressed/${{}##*/}: bad substitution Some googling around suggested

Advertisement