The following code can get the input from Gedit External Tool as you assigned for 'input'.
#!/bin/bashThe trick is the command of xargs.
search=`xargs`
echo $search
Also available Environment Variables in Gedit External Tool are:
=====================
GEDIT_CURRENT_DOCUMENT_URI
GEDIT_CURRENT_DOCUMENT_NAME
GEDIT_CURRENT_DOCUMENT_SCHEME
GEDIT_CURRENT_DOCUMENT_PATH
GEDIT_CURRENT_DOCUMENT_DIR
GEDIT_DOCUMENTS_URI
GEDIT_DOCUMENTS_PATH
An example: compile java file and run it
=========================
javac $GEDIT_CURRENT_DOCUMENT_NAME && java -cp . `echo $GEDIT_CURRENT_DOCUMENT_NAME | sed s/.java//`
No comments:
Post a Comment