Question about executing a script

All Gurus once were Newbies
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
Post Reply
fs0ciety
Level 1
Level 1
Posts: 15
Joined: Tue Mar 26, 2019 1:46 am

Question about executing a script

Post by fs0ciety » Fri Mar 29, 2019 8:45 pm

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?

User avatar
catweazel
Level 19
Level 19
Posts: 9751
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Question about executing a script

Post by catweazel » Fri Mar 29, 2019 8:58 pm

fs0ciety wrote:
Fri Mar 29, 2019 8:45 pm
Am I doing it wrong?
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.

fs0ciety
Level 1
Level 1
Posts: 15
Joined: Tue Mar 26, 2019 1:46 am

Re: Question about executing a script

Post by fs0ciety » Fri Mar 29, 2019 9:01 pm

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

gm10
Level 19
Level 19
Posts: 9796
Joined: Thu Jun 21, 2018 5:11 pm

Re: Question about executing a script

Post by gm10 » Fri Mar 29, 2019 9:22 pm

catweazel wrote:
Fri Mar 29, 2019 8:58 pm
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.
~/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.

Post Reply

Return to “Newbie Questions”