How do a run a bash script on save in NetBeans?

How do a run a bash script on save in NetBeans?

I am using NetBeans 6.5 and whenever I save a LessCSS file I would like to run less compiler to compile it to native css. How do I go about achieving this?
Many Thanks.
Ravi
EDIT: I can do a build file as Kim recommended below. I am searching for a solution where I can run an external command. So the question now is How Do I Run an External Command using Ant?

Solutions/Answers:

Solution 1:

Does it have to be on save? Instead, you could create a custom project (with a custom build file) and just put it into that build file.

References

Related:  What's the difference of redirect an output using “>”, “&>”, “>&” and “2&>”?