I'm trying to use the following script:#!/usr/bin/env bash# Edit xselection in gvimxsel > /tmp/xselectiongvim /tmp/xselectionxsel < /tmp/xselectionBut the final line does not seem to be correctly loading the file into xselection. If I run that line immediately after calling the script it succeeds. I can't understand why. What am I missing?
xsel < /tmp/xselection not working in script
shell;xorg;vim;utilities;clipboard
You're missing the fact that the call to gvim does not block until you exit gvim, it returns immediately.  So the xsel < /tmp/xselection is processing the file before you edit it.