Start > Linux Tips & Trics > WAN IP address to clipboard (KDE only!)

WAN IP address to clipboard (KDE only!)

30 oktober 2006

Often I want to copy/paste my WAN IP address, here is a shellscript for it (warning: kde only, requires wget and sed, no error detecting whatsoever!)

  1. #!/bin/bash
  2. ip=$(wget -q -O – http://checkip.dyndns.org/ | sed ‘s/.+ (([[:digit:]]{1,3}.){3}[[:digit:]]{1,3}).+/1/’)
  3. dcop klipper klipper setClipboardContents $ip
  4. echo $ip
Categorieën:Linux Tips & Trics Tags:
Geen reacties mogelijk.