One workaround is to configure svnnotify
with the -a
parameter instead of -d
(see svnnotify docs) so that instead of sending a email with the svn diff inline in the email, it sends a email with the diff as a email attachment. The advantage of this is that I can click on the attachment in Evolution and "Open with gedit", for example (gedit knows how to syntax hightlight a diff so it is more readable).
Meta: I won't accept this as a answer, because it is only a workaround. Perferably I'd like to receive the diff inline and have it rendered by Evolution.
Another workaround is to use Thunderbird for my mail client - but I like Evolution, the killer feature for me is the contacts sync with Ubuntu-one account.
What you are trying to do is not possible that way.
Note that there are always two sides to that: The client side and the server side. Is the script on the client computer or on the server?
If it's on the client: You as the visitor are only seeing an HTML website. onClick
will only be able to launch JavaScript (or other scripting languages), but not any arbitrary shell script that resides on your computer. HTML scripts only run in the browser and can only do limited things. Most importantly, they can't interact with your computer.
Think about it: How would the browser know how to open the file? Don't you think this would be a security issue as well – a plain website triggering the execution of scripts on a client's computer? What if there was something like onClick('rm -rf /home/user')
?
An alternative would be to run a Java applet, if you want code to be executed on the client, but this not exactly the same and it's something really complicated. I don't think it's necessary to explain this in detail.
If the script is on the server: If you want to run a script on the server side and have the user trigger its execution, then you need to use a server side programming language. Just HTML won't do it, because it's more or less a static file. If you want to interact with the server, you could for example use PHP.
It has the exec
function to run a command line script that is stored on the web server. So basically, you could write exec('/path/to/name.sh');
and it would run the script on the server.
However, just putting this into onClick
is not enough here. If you don't know about PHP and server side web programming yet, you might want to read a few tutorials first and then come back with a more specific question.
If you have a php file with the appropriate exec(...)
command, make sure the script has execute permissions set not only for the user but also for the group the web server is in, so in the simplest case just 777
.
In case of trouble check for the return value of the script with echo exec(...);
to see if there are any errors.
You can also run the script from the command line and not from the browser with php /path/to/file.php
.
Best Answer
Try adding
-a "Content-type: text/html;"
to the message like this:You can easily test this by running this command that
echo
’s simple HTML to themail
command:Got this idea from this question and answer thread on Unix & Linux Stack Exchange as well as this similar thread on Stack Overflow.