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? |
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.
|
./channels.sh did the trick.
Thank you |
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.
|
All times are GMT -5. The time now is 12:59 PM. |