LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-11-2016, 12:53 PM   #1
XicKy
LQ Newbie
 
Registered: Nov 2006
Distribution: Ubuntu
Posts: 17

Rep: Reputation: 0
Must include full path to symbolic link command


Hi. I'm trying to set up a vagrant box for laravel framework. I downloaded homestead. The homestead command is a symbolic link and I put it in my path in /etc/environment. But I can only run the command successfully if I provide the full path to it on the command line. Even if I cd into the directory and try to run it there I get "command not found". Any ideas?
 
Old 05-11-2016, 01:15 PM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,719

Rep: Reputation: 3034Reputation: 3034Reputation: 3034Reputation: 3034Reputation: 3034Reputation: 3034Reputation: 3034Reputation: 3034Reputation: 3034Reputation: 3034Reputation: 3034
Is it in your PATH? try:
Code:
echo $PATH
and check to see if the path to your link is there?

When you say you cannot run it from the directory, please show how you are trying to run it?
 
Old 05-11-2016, 01:31 PM   #3
XicKy
LQ Newbie
 
Registered: Nov 2006
Distribution: Ubuntu
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by grail View Post
Is it in your PATH? try:
Code:
echo $PATH
and check to see if the path to your link is there?

When you say you cannot run it from the directory, please show how you are trying to run it?
This is my path when i echo $PATH: "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:$HOME/.composer/vendor/bin"

if I do:
$ cd ~/.composer/vendor/bin
$ homestead

I get 'command not found'

if I do:
$ ~/.composer/vendor/bin/homestead

then it runs.


the link with ls -alF looks like: homestead -> ../laravel/homestead/homestead*
 
Old 05-11-2016, 01:44 PM   #4
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,719

Rep: Reputation: 3034Reputation: 3034Reputation: 3034Reputation: 3034Reputation: 3034Reputation: 3034Reputation: 3034Reputation: 3034Reputation: 3034Reputation: 3034Reputation: 3034
ok, so we have 2 problems:

1. Just like when you run the command using the full path, when you run it from the directory yuo are in you need to tell it where it is:
Code:
$ cd ~/.composer/vendor/bin
$ ./homestead
The '.' means this directory, so it is a relative path instead of an absolute one

2. Your PATH variable should have all other variables expanded, so $HOME should not appear when you echo it. I would suggest you have set the PATH variable something like:
Code:
PATH=$PATH:'$HOME/.composer/vendor/bin'
And the single quotes are preventing the expansion. Try using double quotes around the entire string:
Code:
PATH="$PATH:$HOME/.composer/vendor/bin"
 
1 members found this post helpful.
Old 05-11-2016, 02:01 PM   #5
XicKy
LQ Newbie
 
Registered: Nov 2006
Distribution: Ubuntu
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by grail View Post
ok, so we have 2 problems:

1. Just like when you run the command using the full path, when you run it from the directory yuo are in you need to tell it where it is:
Code:
$ cd ~/.composer/vendor/bin
$ ./homestead
The '.' means this directory, so it is a relative path instead of an absolute one
DOH!

Quote:

2. Your PATH variable should have all other variables expanded, so $HOME should not appear when you echo it. I would suggest you have set the PATH variable something like:
Code:
PATH=$PATH:'$HOME/.composer/vendor/bin'
And the single quotes are preventing the expansion. Try using double quotes around the entire string:
Code:
PATH="$PATH:$HOME/.composer/vendor/bin"
I had edited /etc/environment. I changed the entry in that file to the absolute path, no variables or ~/ and it works now.

Thanks!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Symbolic link to Windows mshome path john0000 Linux - Networking 9 12-14-2006 04:36 PM
The command to make a symbolic link Gins Linux - General 10 11-12-2006 01:58 PM
absolute path from symbolic link vishalbutte Programming 1 01-16-2006 01:13 AM
symbolic link to the realplay script is in your PATH Baracuda Linux - Software 1 10-03-2005 02:31 AM
ls -laL command for Symbolic Link jlaruffa Linux - Newbie 7 06-22-2003 12:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration