Update: Included a lot more relevant information, thank you for suggesting including this!
I am very new to Linux and I am trying to run scripts that someone else created. I recently learned about the
$PATH variable, and realized that I need to add my scripts folder to my
$PATH variable in order to make it callable from anywhere on the terminal. However, even when I add the folder containing my script to the
$PATH variable, the script inside is not being recognized.
I have edited my bashrc file in a text editor, at the bottom to include:
#Modify $PATH export PATH="/home/eli/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
My script is located in
/home/eli/bin, if I don't specify the entire path, the script will not run despite this bin being in my $PATH variable.
So, here's my $PATH variable:
(base) eli@eli-XPS-13-7390-2-in-1:~$ echo $PATH /home/eli/miniconda3/bin:/home/eli/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
Here are my script permissions:
(base) eli@eli-XPS-13-7390-2-in-1:~$ ls -al ~/bin/trim2bRAD_2barcodes_noAdap.pl -rwxr-xr-x 1 eli eli 3064 May 19 2018 /home/eli/bin/trim2bRAD_2barcodes_noAdap.pl
Here is the output when I try to run the script without being in the directory or specifying the exact path to the file:
(base) eli@eli-XPS-13-7390-2-in-1:~$ ./trim2bRAD_2barcodes_noAdap.pl bash: ./trim2bRAD_2barcodes_noAdap.pl: No such file or directory