I've wrote the following short script to make this posible:
Code: Select all
#!/bin/bash
while :
do
$(head -1 cmd.txt)
> cmd.txt
done
This script is able to check the first line of the file "cmd.txt" and execute it. After this it clears the file.
If this script runns in background, you can do e.g. the following in GP:
Code: Select all
self_writeFile 'cmd.txt' 'shutdown now'
This is nothing special but I thought; I shuld share it and I will extand this script to output the result of the command to be used in GP. It should be also posible to write a Batch scirpt to do the same on Windows.