viewtopic.php?p=3060#p3060
You are absolutely correct there. If you simply type $PATH you are running its content as if it is a command, which shows its content certainly, but also gets error message sent to standard error device (so generally appears on your display screen as part of the resultant output).cobaka wrote: Thu Aug 20, 2020 11:53 pmOn the topic of $PATH:
$PATH is a variable not a command.
echo is a command.
This is what I figure: When I type at the CLI (the command-line interpreter/the shell) I must precede the name of a variable by a command.
As far as standard, generally recommended locations for executables is concerned (and yes, scripts can be made executable via chmod +x path_to_scriptname) I would advise you look at the following. It is simple enough:
https://refspecs.linuxfoundation.org/FH ... index.html
or...
If you intend taking up Linux System Admin as a professional (or simply following their lead) then Red Hat is the major commercial Linux and Red Hat Enterprise Linux documentation the main source for the majority of professional Linux courses used by the majority of national tertiary education institutions, so RHEL manuals (despite being Red Hat focussed more generally) are a great resource for answering such questions. For example, you can go to RedHat site and try and find latest, but I preferred the way they previously presented their manual, so this one should do for your understanding:
https://web.mit.edu/rhel-doc/5/RHEL-5-m ... m-fhs.html
There is however really nothing to stop a system admin assigning other locations for executables and putting these other locations in the search PATH. That's what Puppy developer has done with /root/my-applications/bin. However, if systemd had been around and... Puppy had happened to adopt that (sigh) they could well have used $HOME/.local/bin (~/.local/bin/), which is actually quite a handy alternative anyway. It is detailed here:
https://www.freedesktop.org/software/sy ... archy.html
By the way, early UNIX only had binary commands, hence the bin name for where commands are stored. However, shell scripts include a hash bang header such as #!/bin/bash. When these shell scripts are made executable it is actually the binary /bin/bash that gets run and the shell script itself simply provides the lines to be interpreted:
https://unix.stackexchange.com/question ... n-that-way
Another reference document, programmers might find it useful to become familiar with is Linux Standard Base:
https://refspecs.linuxfoundation.org/lsb.shtml
For example for list of libraries that should be available on a Linux Standard Base system (including the names they should have):
https://refspecs.linuxfoundation.org/LS ... ments.html
and expected commands:
https://refspecs.linuxfoundation.org/LS ... mands.html
Whilst above could be said to be of interest mainly to programmers much of it is not overly technical for experienced Linux users and probably of some interest to many more generally.
wiak