You are not logged in.

#1 2016-11-15 02:27:32

Sofflock
Member
Registered: 2009-04-16
Posts: 24

Scripts in ~/bin not working without the exact folder path. [SOLVED]

Hello,

Not sure if I can actually even call it a script, but I have created shortcuts to start different virtual machines and placed them in /home/bin.
When I had just created them they worked but not any longer.

VBoxManage startvm Debian > /dev/null

I saved it as debian, and ran chmod +x debian.

When I run ./bin/debian it works fine.

but as I understand the scripts located in /home/bin should be recognized automatically.

Anyone can help me figure out why they stopped working?

Cheers,

Last edited by Sofflock (2016-11-15 02:47:37)

Offline

#2 2016-11-15 02:30:40

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,559

Re: Scripts in ~/bin not working without the exact folder path. [SOLVED]

Sofflock wrote:

but as I understand the scripts located in /home/bin should be recognized automatically.

Why would you assume that? Unless you add it to $PATH, it's not gonna work.

Offline

#3 2016-11-15 02:31:55

metak
Member
Registered: 2009-09-27
Posts: 198

Re: Scripts in ~/bin not working without the exact folder path. [SOLVED]

You have to export that path: 

export PATH=$PATH:/home/bin

. Best to put that line in .bashrc or something.

Offline

#4 2016-11-15 02:46:57

Sofflock
Member
Registered: 2009-04-16
Posts: 24

Re: Scripts in ~/bin not working without the exact folder path. [SOLVED]

metak wrote:

You have to export that path: 

export PATH=$PATH:/home/bin

. Best to put that line in .bashrc or something.


Ah yes, that worked perfectly, just added the line

export PATH=$PATH:/home/micke/bin

and now it works.

Thanks alot!

Offline

#5 2016-11-15 03:24:31

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,529
Website

Re: Scripts in ~/bin not working without the exact folder path. [SOLVED]

For things that short you may just want to make functions or aliases in your bashrc rather than creating a script for each one.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB