I'm converting a shell script which xclip and similar tools on Linux, to use pbpaste and pbcopy on Mac. The problem is the default pasteboard ('general' according to the man-page) for these tools is not the one being used by Stickies / Safari / TextMate / all the GUI apps.
I've tried all the pasteboard names mentioned in 'man pbpaste' but none contain the data I copy in any GUI app. If I load data into the 'general' pboard using 'pbcopy' I can extract it fine via 'pbpaste' - but it's separate from the GUI pasteboard.
Note I'm not running any unusual shell, Terminal or WindowServer settings, this is standard 10.7 Terminal and bash.