Suppose I have a script, " myscript.sh", and the content is simple echo $PWD. I would like to somehow attach this script to a key combo in bash( gnome-terminal) - so when I press this key combination, the output is " myscript.sh" inserted ("inserted") at the cursor position in the terminal.
Apparently the bashstory and line manipulation are handled by readline - and the links I got for the bashshortcuts make a link readline:
I also saw in the bash Reference Guide: The syntax of the Readline initialization file that key bindings for bashcan be listed in using bind -p(see help bind[not 'man bind'] for more). Therefore, perhaps this question is better called "_binding macros to custom key combinations in readline" :) But in any case, is this what I want to do?
I suppose an alternative would be to have a script something like " pwd | xsel -b", and then I call it on the terminal - and then I can paste it; but I still would like to use only one key combination, for example Ctrl-Alt-H (which, it seems, is not used for anything), which immediately inserts / inserts script output when pressed.
Thanks in advance,
Hooray!
EDIT: - , . cd 'd , - myproject-folder-0012a, svn. . , - , :
svn ci -m "myproject-folder-0012a: here a commit message"
, - 11 , :
svn ci -m "
, ( ), , ( :)), ( - , , , Ctrl + Shift + C, Ctrl + Shift + V, /, - , ).
- , :( - () Ctrl-Alt-H , , :)
xsel , "" script - , /usr/bin/myscript (, , script echo $(basename $PWD), pwd ), :
$ myscript
$ svn ci -m "[CTRL+SHIFT+V TO PASTE HERE]myproject-folder-0012a[NOW TYPE]: here a commit message"
... , - , script, . svn )... - , ; , ?!:)
, , ...
EDIT2: , bash , , "/ " , , , nano ( , bash script ).