Skip to main content
edited tags
Link
Kusalananda
  • 355.8k
  • 42
  • 735
  • 1.1k
added 1060 characters in body
Source Link

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:/home/eli/miniconda3usr/bingames:$HOME/Scriptsusr/2bRAD_Edwards_Lab"local/games"

My script is located in $HOME/Scriptshome/2bRAD_Edwards_Labeli/bin, butif 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 it it saysthe script without being in the directory is not found. Can anyone help?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

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="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/eli/miniconda3/bin:$HOME/Scripts/2bRAD_Edwards_Lab"

My script is located in $HOME/Scripts/2bRAD_Edwards_Lab, but when I try to run it it says the directory is not found. Can anyone help?

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
text
Source Link
thanasisp
  • 8.5k
  • 2
  • 29
  • 40

I am very new to Linux and I am trying to run scripts that someone else created. I recently learned about the $PATH$PATH variable, and realized that I need to add my scripts folder to my $PATH$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$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="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/eli/miniconda3/bin:$HOME/Scripts/2bRAD_Edwards_Lab"

My script is located in $HOME/Scripts/2bRAD_Edwards_Lab$HOME/Scripts/2bRAD_Edwards_Lab, but when I try to run it it says the directory is not found. Can anyone help?

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="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/eli/miniconda3/bin:$HOME/Scripts/2bRAD_Edwards_Lab"

My script is located in $HOME/Scripts/2bRAD_Edwards_Lab, but when I try to run it it says the directory is not found. Can anyone help?

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="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/eli/miniconda3/bin:$HOME/Scripts/2bRAD_Edwards_Lab"

My script is located in $HOME/Scripts/2bRAD_Edwards_Lab, but when I try to run it it says the directory is not found. Can anyone help?

Fixed formatting
Source Link
ajgringo619
  • 3.6k
  • 2
  • 18
  • 41
Loading
Source Link
Loading