The Linux.uk Community Forum

General Help & Advice => Linux Support => Topic started by: Keith on April 29, 2022, 06:38:08 PM

Title: Can't execute scripts [SOLVED]
Post by: Keith on April 29, 2022, 06:38:08 PM
I've just bought a new laptop - Dell Latitude E5570 - and am still trying to come to terms with its quirks.  Installed Ubuntu 20.04.   

I have all my scripts in a directory /home/keith/.bin and have changed the PATH to include it:
[email protected]:~$ echo $PATH
/home/keith/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

....and I've made the scripts executable.  But when I type a script name I get a "command not found" error. 

I've not had problems in the past as the process is so simple.  Any ideas what I'm not doing?

Keith
Title: Re: Can't execute scripts
Post by: Brian000 on April 30, 2022, 09:54:06 PM
Keith,


it looks like you've done this, but I'll add it here for others:
https://www.poftut.com/set-path-bash-shell-linux/

I assume that these work:
/home/keith/.bin/script.sh
and
~/.bin/script.sh
?

i'd check the directory permissions too....may ensure those permit execute too (just in case)







Title: Re: Can't execute scripts
Post by: Brian000 on April 30, 2022, 10:49:58 PM
thinking about it....

/home or /home/keith isn't on another partition is it??? check /etc/fstab isn't mounting them as 'non executable'


Title: Re: Can't execute scripts
Post by: Keith on May 01, 2022, 12:21:26 AM
Hi Brian.

Your commands don't work, surprisingly, although if I go to the directory .bin where the scripts are, that appears to work.
But your suggestion of changing directory permissions worked a treat!  As directory permissions are not generally shown, it didn't even occur to me to try that.   
Many thanks.    

Keith