Excerpts from Steven Haddock's message of 2016-03-10 07:14:25 +0100:
> > 3 distinction concepts - permissions, hash bang lines and the PATH - that
> > need to be understood in rapid succession.
> In Practical Computing for Biologists, we pondered this exact challenge, and
> this is one of the few places where we basically say “This is not going to
> make a lot of sense at first, but just trust us and do exactly what we say."
> I don’t think there is much value in protracting this stage, or explaining
> all the subtleties of chmod, difference between ${PATH} and $PATH, etc, at
> this stage. We explain that to be able to execute a script, you have to do
> three things (as you said): tell the system what program to use to process it
> (shebang line), tell the system where to look for scripts (PATH), and then
> say that you don’t want the system executing just any text file unless you
> give it permission.
i would skip the PATH entirely
adding directories to the PATH without understanding the risks is dangerous
(there might be other executables in there that you don't want, and someone
might get the idea to add ".")
it will also cause problems when you work on multiple projects, and you have a
script with a generic name for each, eg run, start, build or something like
that.
there are other ways:
copy the script to ~/bin/ or to /usr/local/bin/ which should be in the PATH
already. if the script has a generic name the problem will become obvious.
execute it from the directory where it is as ./script
execute it with full path.
or even source it. that last one would not even require #! or permissions.
greetings, martin.
--
eKita - the online platform for your entire academic life
--
chief engineer eKita.co
pike programmer pike.lysator.liu.se caudium.net societyserver.org
secretary beijinglug.org
mentor fossasia.org
foresight developer foresightlinux.org realss.com
unix sysadmin
Martin Bähr working in china http://societyserver.org/mbaehr/
_______________________________________________
Discuss mailing list
[email protected]
http://lists.software-carpentry.org/mailman/listinfo/discuss_lists.software-carpentry.org