Wrapping the CopyToClipboard[]
in a UsingFrontEnd[]
allows us to use it in scripts:
#!/usr/bin/env wolframscript
string = "Pshhhkkkkkrrrrkakingkakingkakingtshchchchchchchchchdingdingding";
UsingFrontEnd[CopyToClipboard[string]];
If a FrontEnd is already running you may have to quit it, and then rerun this script