Skip to content

Instantly share code, notes, and snippets.

@swipswaps
Last active December 21, 2021 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save swipswaps/2b366eb07168e0ec620ee6ea6b225cbe to your computer and use it in GitHub Desktop.
Save swipswaps/2b366eb07168e0ec620ee6ea6b225cbe to your computer and use it in GitHub Desktop.
clipboard substitution of forward slash characters to underscore using xsel or xclip
//xsel or xclip awk clipboard substitution of forward slash characters
//Copyright ©2021 by @swipswaps, All rights reserved.
//https://gist.github.com/swipswaps/2b366eb07168e0ec620ee6ea6b225cbe
//clipboard substitution of forward slash characters to underscore using xsel
#echo $(xsel -ob) |awk '{gsub(/\//,"_",$0)}1' |xsel -ib && xsel -ob
//clipboard substitution of forward slash characters to underscore using xclip
#echo $(xclip -o -selection clipboard) |awk '{gsub(/\//,"_",$0)}1' |xclip -selection c && echo $(xclip -o -selection clipboard)
//clipboard https:// removal & substitution of forward slash characters to underscore using xclip
#echo $(xclip -o -selection clipboard) |awk '{gsub(/https:\/\//,"",$0)}1' |awk '{gsub(/\//,"_",$0)}1' |xclip -selection c && echo $(xclip -o -selection clipboard)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment