PDA

View Full Version : [ubuntu] How to paste a file content into xterm by script?



honeybear
November 29th, 2010, 10:48 PM
Hello, I would like to paste a file content into xterm by script, using xsel or xclipboard or whatever works. What are the alternative programs since they are not intended for that :(

Christmas
November 29th, 2010, 11:35 PM
Hi. I'm not sure I understand your question. You can use cat filename in a Bash script, and it will show the content of the file. You can also use pipes in the script to grab the output and parse him or do whatever you want e.g. cat filename | grep Ubuntu will show only the lines that contain the term "Ubuntu" (case sensitive).

honeybear
November 30th, 2010, 06:39 AM
Hi. I'm not sure I understand your question. You can use cat filename in a Bash script, and it will show the content of the file. You can also use pipes in the script to grab the output and parse him or do whatever you want e.g. cat filename | grep Ubuntu will show only the lines that contain the term "Ubuntu" (case sensitive).

I was thinking in a way:


echo "Hello" > /tmp/myfile
echo "Bye" >> /tmp/myfile
echo "Click on xterm"
sleep 10s
cat /tmp/myfile | pastetoX11
# or
cat /tmp/myfile | xsel --clipboardtox11



something like that

earthdan
June 15th, 2011, 06:54 PM
how to use xclipboard from command line??

uRock
June 15th, 2011, 07:04 PM
Try
man xclip in a terminal. If you need guidance with this, then please start a new thread, instead of awakening old threads.

Thread Closed