Guid To Windows Clipboard Using Cygwin

Guid Generation
This will give you a guid to your Windows clipboard using Cygwin.

uuidgen | awk '{print "{" toupper($0) "}" }' | putclip

If you don’t like the newline that gets added, you can do this:

uuidgen | awk '{print "{" toupper($0) "}" }' | tr -d '\n' | putclip

Now, for Bash on Linux, maybe you can substitute xclip for putclip to get it into your X Windows clipboard. There may be some additional arguments for that also.

Change To Directory in Clipboard
This handy alias to stuff in your ~/.bashrc file allows you to change to directory in Windows clipboard. Copy path using ^C in Windows Explorer and then issue this command to switch to it at the Cygwin bash prompt.

alias cdw='cd "$(cygpath "$(getclip)")"'

This entry was posted in Bash, Cygwin, Snippets and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *