You are not logged in.
EDIT:
Right after writing this post I figured out that I was trying to run the script the wrong way../netstat.shI guess is not the proper command????
Because when I do
netstat.shIt works perfectly.
Sorry to waste anyones time but I figured that leaving this up may help someone else in the future.
I will research what the difference makes in the commands.
I have been for what seems like forever trying to setup a bin folder in my home directory for my personal scripts and can not get it to work(on any distro I have tried it one actually)
(the **** in the following commands represents my user name on the machine which I feel is irrelevant)
For starts I imagine one might want to see this first
uname -a
Linux arch 5.5.5-zen1-1-zen #1 ZEN SMP PREEMPT Thu, 20 Feb 2020 18:22:57 +0000 x86_64 GNU/Linuxand also
Output of $PATH
bash: /usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl://home/****/bin: No such file or directoryWhat I have done is:
For reference the source of the method I used is
Trying to do what is mentioned in the Per User section,
I used the following commands in my terminal
I added
export PATH="${PATH}:/home/****/bin"to my users bash_profile like it tells me to.
And then both both re logging in and also(because neither helped)
source ~/.bash_profileEven as a last ditch effort rebooted the machine.
Still did not let me run my script that is in the bin directory that is inside my users home directory using
./netstat.shAnd I get the following output
./netstat.sh
bash: ./netstat.sh: No such file or directoryWhich is just a simple script that runs
ss -atunand refreshes every 15 seconds to show connections to the machine.
My script for reference just in case it helps or anyone is just plain curious.
#!/bin/bash
while true
do
ss -atun
sleep 15
clear
doneRuns exactly like it is supposed to when I call(is that the proper wording?) the path to it.
/home/****/bin/./netstat.shIt is named netstat because I used to use net-tools instead of iputils(I think I named the package correctly)
Thank you to anyone that tries to help.
Last edited by plutoG (2020-02-22 21:27:45)
Offline
Calling anything with ./ will not invoke a PATH lookup. "." is your current local directory. If you want your PATH to be checked use just
netstat.shIt's also weird that according to the path echo there seems to be a random stray / somewhere, but it shouldn't inherently matter.
Last edited by V1del (2020-02-22 21:10:46)
Offline
I see what the problem was now thank you for the information.
Last edited by plutoG (2020-02-27 08:38:56)
Offline
Please mark as [SOLVED] by editing the title in your first post: https://wiki.archlinux.org/index.php/Co … ow_to_post
Offline
Please mark as [SOLVED] by editing the title in your first post: https://wiki.archlinux.org/index.php/Co … ow_to_post
Sorry about that I forgot.
EDIT:
@V1del
Calling anything with ./ will not invoke a PATH lookup. "." is your current local directory. If you want your PATH to be checked use just
netstat.shIt's also weird that according to the path echo there seems to be a random stray / somewhere, but it shouldn't inherently matter.
Somehow it went away when I did it over again to try and figure out why this was the case.
More likely than not I had the command typed wrong which i tend to do a lot because I try to type too fast.
And again thank you very much for the help.
Last edited by plutoG (2020-02-27 08:39:09)
Offline