LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 08-30-2011, 04:02 AM   #1
rytec
Member
 
Registered: Mar 2009
Location: Belgium
Distribution: Ubuntu server 12.04 LTS / Raspbian Wheezy
Posts: 64

Rep: Reputation: 7
How to run a symbolic link as a script


I have created a symbolic link with the command ln -s /etc/xmltv/ftpchannels.sh channels.sh
Then I changed the symlink channels.sh with chmod 755 but when I type in the commandline channels.sh it gives me the message channels.sh: command not found
The symlink @channels.sh is in my root directory.

Or do I need to put the #bin/bash! line in top of the original script? till now I always have run the script as /etc/xmltv/ftpchannels.sh and it works.

Where am I going wrong?
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 08-30-2011, 04:12 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
don't mess with the symlink, the permissions of the destination file are what matter. if you can run the script directly then a symlink to it should work just the same way. It sounds here that you've just got a path issue, run "./channels.sh" then I bet it'll work. your current directory should *never* be on your path, so unless you explicitly state you want to run something in the current directory, it won't find it.
 
2 members found this post helpful.
Old 08-30-2011, 04:26 AM   #3
rytec
Member
 
Registered: Mar 2009
Location: Belgium
Distribution: Ubuntu server 12.04 LTS / Raspbian Wheezy
Posts: 64

Original Poster
Rep: Reputation: 7
./channels.sh did the trick.

Thank you
 
Old 08-30-2011, 04:30 AM   #4
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,255

Rep: Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686
I would add that the command you submitted, chmod 755, will in fact act on what the link is pointing to and not the link itself.
 
1 members found this post helpful.
  


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
Script to move old files, create symbolic link d3coy Linux - Newbie 8 11-09-2011 02:26 PM
symbolic link script rismoney Programming 1 02-25-2009 01:07 AM
How to create symbolic link to html file and avoid page link problem? haxpor Linux - General 2 01-29-2008 08:40 AM
symbolic link to the realplay script is in your PATH Baracuda Linux - Software 1 10-03-2005 03:31 AM
need help with symbolic link to shell script scottsteibel Linux - Software 8 08-03-2003 12:11 AM


All times are GMT -5. The time now is 03:49 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