I am trying to create a simple drop of Automator that will transfer a file into it style.lessand run the following LESS command:
$ LESSC {DROPPED_FILE} --watch
which will control the file that I ran for any changes, and then automatically update the output style.css
FYI: I use LESS to create dynamically written CSS files. More info here .
The main drop works fine.
- The discarded file is passed to the variable; For this purpose:
{MY_VAR}. - I run the shell script in the shell
/usr/bin/rubyas followssystem("lessc {MY_VAR} --watch &")
this works fine, but I want -watch to be stopped after exiting the vending application.
The LESS documentation specifies the CTRL-C key combination, and the script terminates on the command line.
But since I am not in the terminal window (the command is transmitted in the background), I do not know how to interrupt the script.
Even after automator.app has been closed, the file style.lessis still scanned for changes, and the generated generated one style.cssis still overwritten.
So basically I need to pass the abort command when exiting .app.
I created a simple pop-up inscription that closes the application after clicking , transferring another command to the terminal shell.
This is the part where all my attempts failed to stop the script.
Is there a command line function that acts the same as pressing CTRL-C? How to convey this best for the shell?