←back to thread

837 points yen223 | 1 comments | | HN request time: 0.218s | source
1. wodenokoto ◴[] No.42074915[source]
pbcopy and pbpaste are among my top commandline utilities. If you are running linux in WSL, you can add the following to you path to recreate their functionality:

    # pbpaste
    #!/bin/bash
    # Adapted from https://www.techtronic.us/pbcopy-pbpaste-for-wsl/
    powershell.exe Get-Clipboard | sed 's/\r$//' | sed -z '$ s/\n$//'
    exit 0
and

    # pbcopy
    #!/bin/bash
    #Adapted from https://www.techtronic.us/pbcopy-pbpaste-for-wsl/
    <&0 clip.exe
    exit 0