I'm trying to pass the array contained in a global variable I've created into my clipboard on my mac.
It is very long so I don't want to highlight, copy & paste on my console.
I want to use embedded unix code, specificially the pbcopy
function for the mac laptop console that allows me to pass text into my computers clipboard, ready to paste.
Were I to do this with a file-save, I'd do something like this (in ruby):
stringdata = <<blah blah blah process, lets say it failed and the progress data is stored in this variable so we can skip forward to where the script screwed up in a process when we start up and handle the error instance(s)>>
File.open("temp.txt"){|f| f.write(stringdata)}
`cat temp.txt | pbcopy`
But could I possibly do this without creating a temporary file?
I'm sure this is possible. All things in text are possible. Thanks in advance for the solution