Skip to main content

All Questions

Tagged with
1 vote
2 answers
7k views

add single binary to PATH

Maybe this is a WSL question, in which case I'm not sure where to ask. I have a single binary that I want to add to path ~/.scry/bin/scry. So I went to ~/.bashrc and added export PATH="$HOME/....
Julian A Avar C's user avatar
3 votes
2 answers
721 views

Awk: Scripts on the path?

Is there a way to put little awk scriptoids on the path? For example, I have this really useful collation operation: // collate-csv.awk FNR > 1 || NR == 1 And I can use it in all sorts of great ...
Chris's user avatar
  • 983
11 votes
2 answers
4k views

Understanding the "-p" option to "command" in Bash and its interaction with the default PATH

The command command in bash: Run command with arguments ignoring any shell function named command. The -p option means to use a default value of $PATH that is guaranteed to find all of the standard ...
testter's user avatar
  • 1,470
0 votes
1 answer
875 views

How to dynamically change path for different environment?

I have different versions of CUDA installed in /usr/local/cuda-... and I need some way to select the right version for different projects. I tried export CUDA_HOME=/usr/local/cuda-10.0 export PATH=\$...
Sarien's user avatar
  • 143
-2 votes
2 answers
137 views

Environment Variable and PATH issue

I tried to set an environment variable for the Sublist3r tool and messed up. Now whenever I switch to the root user (with sudo su) the only command I am able to use is exit (attaching the images). I ...
Vini sharma's user avatar
1 vote
1 answer
708 views

Duplicate Paths, Issues with .bash_profile

I was directed here from Stack Overflow after posting a question about struggling to get PyExifTool to work. It seems however that the problem was multifaceted and being a novice I was told to seek ...
Solebay Sharp's user avatar
4 votes
2 answers
11k views

.bashrc: syntax error near unexpected token '('

I use the Windows Subsystem For Linux. On launching Ubuntu, I get this errors: -bash: /home/divyansh/.bashrc: line 119: syntax error near unexpected token `(' -bash: /home/divyansh/.bashrc: line 119: `...
Divyansh Hardia's user avatar
2 votes
3 answers
12k views

How to tar only specified files via wildcard?

I would like to tar only specified files. I have tried: $ ls $des/bin a.c analysis.hpp classify.hpp main.cpp split.hpp a.cpp a.out grade.cpp main.out student.cpp ...
milanHrabos's user avatar
0 votes
1 answer
489 views

CentOS 7 PATH overwritten by /etc/bashrc

I have a Dell server running CentOS 7. I installed the iDRAC remote access tools from Dell, and it reset my PATH variable. Some more details: I have a script in /etc/profiles.d which adds something to ...
swami's user avatar
  • 205
1 vote
0 answers
769 views

Set permanent environment variable for all shells

I want to set the root level environment variable that comes from sh(1) so that it is shared across all shells: sh, bash, zsh, and fish. I can see in /etc/profile there's a command /usr/libexec/...
user14492's user avatar
  • 873
0 votes
1 answer
180 views

How to define PATH? Without PATH errors

When I write in .bashrc: export PATH=\$PATH:\/usr/local/qc/OPENMPI_3_1_4/bin/ after a reboot, I get this error with any command line: david@doc1:~> less If 'less' is not a typo you can use command-...
Another.Chemist's user avatar
6 votes
2 answers
11k views

setting JAVA_HOME and PATH with update-alternatives

EDITED The question was more about bash script them java environment and thanks for those whom had the patience and spare the time to reply me. I am much obliged. As for the Java environment I started ...
RicardoPHP's user avatar
0 votes
0 answers
406 views

How does bash and sh find python if it's not in $PATH?

How does the shell know where to find python when I don't have a $PATH variable set? $ env -i bash bash-3.2$ env PWD=/Users/cweber/projects/monorepo SHLVL=1 _=/usr/bin/env bash-3.2$ which python bash-...
weberc2's user avatar
  • 181
0 votes
0 answers
27 views

usr/.local/bin PATH anomaly [duplicate]

In Fedora 30, a youtube-dl problem just surfaced and I resolved it via pip install --user -U youtube-dl. This created ~/.local/bin/youtube-dl. echo $PATH gives ".../home/steve/.local/bin...". ...
user2661923's user avatar
-1 votes
3 answers
1k views

problem with a remote server scp

I have admin access to a remote computer with Debian linux. At first everything were working well. I tried to define some variables globally so that all users can run a specific code. Now I can't scp ...
Mostafa Tavakoli's user avatar
1 vote
1 answer
602 views

How to exclude/hide a directory from a command (find command or else)?

How to exclude a folder or path from a command or application in general? I am trying to exclude a path from find command but available possibilities like prune option explained here and here makes ...
intika's user avatar
  • 14.6k
2 votes
0 answers
812 views

apt-get update no longer works after rebuilding corrupted PATH variable

I royally screwed up my PATH variable last night, thankfully a user called Icarus helped me rebuild it here. However it's not fully fixed and I receive the same (or maybe very similar) error that I ...
Retsek's user avatar
  • 343
0 votes
1 answer
325 views

Why is the wrong bash running? [closed]

Just recently faced (weird to me) bash behavior. My environment is: macOS PATH variable modified to /usr/local/bin:$PATH I don't remember if I've installed it before or it was already there, but the ...
wise-Kaa's user avatar
0 votes
1 answer
1k views

get full path to shared directory

I have done following #!/bin/bash PROJDIR="//$HOST/projects" cd $PROJDIR newscript exit 0 Purpose of the script is to enter in shared folder and trigger another script within it, but the script ...
Vikram Tidake's user avatar
0 votes
1 answer
251 views

Run node script with a global variable

I have a node script index.js with a node_modules folder. /script/myTestJscript/index.js /script/myTestJscript/node_modules /script/myTestJscript/package.json I could run the script with the command ...
emna87's user avatar
  • 1
2 votes
3 answers
1k views

How to track which file adds a path in PATH?

Something adds an undesired path to my PATH environment variable. How can I find the culprit? I've already looked at: ~/.bashrc ~/.bash_profile /etc/bashrc /etc/profile /etc/environment
None's user avatar
  • 647
-1 votes
1 answer
75 views

uninstalled program in PATH

I have uninstalled gnome-screenshot, but when I write gnome in terminal and tap TAB, it still suggests gnome-screenshot (and other gnome apps, but it's correct). If I want to use uninstalled gnome-...
Maciek's user avatar
  • 193
1 vote
0 answers
191 views

Performing job array by reading in file paths from a text file

I am trying to perform a job array using script below. #!/bin/bash --login #$ -cwd #$ -t 1-4 module load apps/bioinf module load apps/trimmomatic/0.36/noarch file=`awk "NR==$SGE_TASK_ID" ~/scratch/...
sian's user avatar
  • 11
1 vote
1 answer
453 views

Command in path not found [duplicate]

I've a command in the ~/.local/bin/ path (lets call it dog). Calling the command with the full path ~/.local/bin/dog works as expected . When I do which dog I get the expected ~/.local/bin/dog. When ...
Eden's user avatar
  • 111
1 vote
0 answers
2k views

Unable to execute bash scripts from within fish-shell

I have a collection of bash scripts that I have added to the PATH so that I can execute them from anywhere. export PATH=$PATH:~/<path>/<to>/<scripts> so along with ./<path>/&...
myTerminal's user avatar
2 votes
0 answers
771 views

parallel-ssh not appears in any path after pip installation

we installed the parallel-ssh but after pip successfully installation the command parallel-ssh not appears in any path where we are wrong? locate parallel-ssh which parallel-ssh /usr/bin/which: ...
yael's user avatar
  • 13.4k
0 votes
1 answer
396 views

Use sed to append data BEFORE a closing double quote encasing a Path

I need to append the path /opt/dell/dcc of an application outside of the default path statement in /etc/environment PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/...
F1Linux's user avatar
  • 2,574
1 vote
1 answer
353 views

Since aliases are not inherited, is there any alternative to exporting the executable on the PATH?

I am trying to setup a system to switch between bash versions on a Mac. I have this which works: change_bash_version(){ if test "$1" == "3"; then export PATH="$HOME/bash/versions/3.2.57:${...
Alexander Mills's user avatar
0 votes
2 answers
570 views

Confused about Configuring Linux Path Environment /etc/profile.d/*.sh being Executed Twice?

I am trying to set PKG_CONFIG_PATH to CentOS here are the code I tried export |grep PKG_CONFIG_PATH no output, normal... echo "$PKG_CONFIG_PATH" :/usr/local/lib/pkgconfig why there is output here??...
shadow_wxh's user avatar
1 vote
0 answers
47 views

Add file to PATH only when in specific directory [duplicate]

Is it possible to make executable appear in the global search path when I am entering to the some specific directory and get it removed once directory changed again?
l00p's user avatar
  • 263
1 vote
1 answer
2k views

Portable way to run command without PATH from bash script

cron calls my bash script (it's a backup script) with a very sparse PATH of /usr/bin:/usr. As a result, while a line like lvcreate --size 1G --snapshot ... works just fine when I run the script from ...
Andreas K's user avatar
1 vote
1 answer
303 views

How to check $PATH for installed software in a bash script?

Recently one of my bash scripts failed because cmake and zip / unzip were not installed on a system. What would be a convenient way to check for installed packages in $PATH env? I would like to ...
daniel451's user avatar
  • 1,077
0 votes
1 answer
84 views

"$PATH" being exported as literally "$PATH" [closed]

So in a bash_config profile I have export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk export JAVA_PATH=$JAVA_HOME export PATH=$PATH:$JAVA_HOME/bin But rather than appending the PATH it is setting it ...
bhsantos's user avatar
1 vote
1 answer
6k views

Trying to export a path from inside a bash script [duplicate]

I am trying to put my whole environment set up into a single bash file. I am only hitting one issue. When I try to export a new path from inside the file it is not setting the path in the environment ...
Keith's user avatar
  • 133
0 votes
1 answer
560 views

Why is program not found in PATH [duplicate]

I've installed ipython inside virtualenv on my macOS. My PATH environment variable also shows virtualenv path to be at the beginning. which command also shows that ipython at the correct location. ...
tayfun's user avatar
  • 103
4 votes
1 answer
2k views

Bash can't find scripts in $PATH [closed]

I'm setting up a completely new, fresh Ubuntu 16.04 Minimal system, and have run into a weird problem. Even after adding $HOME/bin to the $PATH, bash can't seem to find any of the scripts in it, at ...
Modus Operandi's user avatar
13 votes
1 answer
3k views

Executable file named 'test' is in $PATH but won't run

I have a file in $HOME/bin (before you ask, yes, it is in my path) called test which I've confirmed can be executed fine when I run it with the full path to the file. However, I get a really weird ...
ContronThePanda's user avatar
0 votes
0 answers
60 views

Changing Path variable

I am not able to permanently change my PATH variable. I tried changing .bash_profile file but, the changes were reverted (however the .bash_profile file had the path which I wrote) when I closed the ...
raghav gade's user avatar
4 votes
1 answer
1k views

Remove executable from path [duplicate]

I have a script called teleport in my path. When I type tele and hit tab, I'd like for tab-completion to complete this to teleport. However, there's another program installed on my system: telepathy-...
Nick ODell's user avatar
  • 2,678
7 votes
1 answer
2k views

Adding path to .profile safely using a script

I want to add a directory to the $PATH environment variable through an install script. I have written a few programs, all present in one directory. They need a lot of other packages installed to run. ...
Yuki.kuroshita's user avatar
0 votes
3 answers
402 views

Bash script with limited path

I'm trying to write my first bash script to essentially install a bunch of dependencies and then execute a script. I'm struggling debugging this with the user b/c I'm a dev which means I already have ...
Catfish's user avatar
  • 75
0 votes
1 answer
62 views

Searching files in $PATH

I have some folders specified in my PATH environment variable. How do I list all the files in these folders?
Eloy's user avatar
  • 137
1 vote
1 answer
988 views

Ubuntu 14.04.2 LTS: 'find' not found in PATH or not executable

I am trying to install some graphics libraries with the following command: sudo apt install jpegoptim optipng It however fails to run with stating the following: Reading package lists... Done ...
ACanal's user avatar
  • 19
0 votes
2 answers
118 views

Properly feed paths to executables in bash script

Hello all I have a text file (1.txt) that contains full paths to binaries which I need to execute a command (val_bin) for each path in the file. 1.txt Example: /source/ed/dev/ed/ab/ed_len/comercial/...
SSDdude's user avatar
  • 171
7 votes
2 answers
14k views

Where is Cygwin set its PATH variable?

If I write echo $PATH in my Cygwin window (mintty) I get a list of paths. That list does not match the Windows Envirnonement variables list. I cannot find a file, where is the variable $PATH set. None ...
Loom's user avatar
  • 3,963
5 votes
1 answer
1k views

Installed program executable runs from wrong location

I installed parcellite in Ubuntu (downloaded from http://parcellite.sourceforge.net/) After installing from sources, sudo make install, I can see that it is installed at below location. However, ...
xxx374562's user avatar
  • 304
0 votes
2 answers
92 views

Add directory to all PATH-like variables [closed]

Is there a function that can add a root folder to all path-like variables? At the moment I use this function: function prepend_paths() { ROOT_PATH=$(readlink -f $1) export PATH=$ROOT_PATH/bin:...
Jens's user avatar
  • 11
0 votes
1 answer
44 views

updating PATH to work for every current working dir

Say I have this defined for PATH export PATH="./node_modules/.bin:${PATH}" does that mean that any process that uses PATH, will have a reference to node_modules/.bin from the current working dir?
Alexander Mills's user avatar
2 votes
3 answers
266 views

Find command that excludes paths listed in a file

I need to exclude a bunch of paths from a find command. For example: find "$(pwd)" -not \( \ -path "*/.git"\ -o -path "*/.git/*"\ -o -path "*/.vscode"\ -o -path "*/.vscode/*"\ -o -path "*/...
Porcupine's user avatar
  • 2,056
1 vote
1 answer
1k views

How can I set PATH in the `dash`(or bash) shell so that it doesn't search any dirs ? because empty PATH searches current directory

In Dash if I set the PATH to an empty string, it searches in current directory: $ export PATH= $ echo $PATH $ emptyexe $ /usr/bin/ls emptyexe emptyexe $ pwd /home/ctor $ cd .. $ emptyexe dash: 36: ...
user avatar

15 30 50 per page