tags:

views:

42

answers:

3

is there any easy way to implement the copy to clipboard option from the output of a shell script ?

+1  A: 

Use Xclip

kazanaki
+2  A: 

You can use the xclip command.

 echo hello | xclip

Instructions for obtaining xclip are here.

dogbane
Thanks..but is there any inbuilt command to do so ?
Krishna
+2  A: 

That may depend on the environment you're using. With Gnome at least (I haven't tried the others but it may work), you can pipe your output as follows:

echo 123 | xclip
echo 123 | xclip -sel clip

The first goes to the mouse clipboard, the second to the "normal" clipboard.

paxdiablo