So I'm trying to learn the command line, and so as is usual when learning a new language I started with the Hello World bash script.
I've been following the guide on this website: http://www.linuxcommand.org/lc3_wss0010.php
At the bottom of that page it talks about the bin directory and how if you move your script in there, you don't have to specify a directory when executing. But it doesn't work for me, if I type the filename without directory I just get "command not found".
Am I doing it wrong?
Question about executing a script
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
- catweazel
- Level 19
- Posts: 9875
- Joined: Fri Oct 12, 2012 9:44 pm
- Location: Australian Antarctic Territory
Re: Question about executing a script
There are several preceding instructions to set
bin
into the path and make it available but it's all wrong. I would be inclined to find a better tutorial as that one skips a lot of the information you actually need to make it work. For example, the bin path is usually /home/$USER/bin
or /home/$USER/.bin
, and it is this path that you must add to the environment but the tutorial skips that entirely. Instead of telling you to use the path, it tells you to use the directory name.I would find a tutorial that is more focussed on ubuntu than on generic linux.
Last edited by catweazel on Fri Mar 29, 2019 9:01 pm, edited 1 time in total.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
Re: Question about executing a script
Hmm yeah to be honest I had my doubts as well as I keep running into trouble and I feel like it isn't clearly explained what I'm supposed to do. I'll try some alternatives tomorrow
Re: Question about executing a script
~/bin
and ~/.local/bin
automatically get added to the PATH via the default ~/.profile
on Mint/Ubuntu. You do however need to source ~/.profile
after you add the directory (or log out and back in) because it only adds to PATH if the directory actually exists. That said, I agree, better find another tutorial.