When opening a new ticket to submit a package on Sourceforge, I have found only Ctrl-V (not the X clipboard accessed by middle click) will paste selected text into the box. All through the previous packaging cycle, my workflow was to select the output of slkbuild-postgen with the mouse, open leafpad, paste it in the window with the middle mouse button, do Ctrl-A Ctrl-C, then go to the browser and paste into the box with Ctrl-V. This quickly becomes annoying, but that is what bash is for, right?
So I wrote this little script, which puts the output of the report generator in the right clipboard, as well as sending it to stdout:
Code: Select all
#!/bin/bash
#post.sh
#run slkbuild-postgen (passing any arguments to it) and output result to the xclipboard sourceforge likes
slkbuild-postgen $@ ./SLKBUILD | tee ~/post.txt
cat ~/post.txt | xclip -selection c
I'm quite new to bash scripting, and cobbled this together with duckduckgo searches. The intermediate step of the file is inelegant and (I suspect and hope) unnecessary. I could just pipe the output of the report generator directly to xclip, but then you wouldn't see it on stdout - a useful check if it is garbage, before going over to Sourceforge to submit the package.
I tried this recommendation from stackexchange, but it threw an error:
Code: Select all
slkbuild-postgen $@ ./SLKBUILD | tee > (xclip -selection c)
Can anyone suggest a neater way?