Stories
Slash Boxes
Comments

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Fletch (75)

Fletch
  (email not shown publicly)
http://phydeaux.org/
AOL IM: lemurnomicon (Add Buddy, Send Message)

Frink? Frink? Phtang!

Journal of Fletch (75)

Friday March 26, 2004
08:58 AM

Changing OS X Location from the command line

[ #18070 ]

Found out about scselect yesterday from here. A couple of minutes effort on the train and I now can change from a shell without having to mouse up to the apple menu.

zsh ++

##
## _scselect -- Completion for OS X Network Location utility
##
_scselect () {
    local locs
    locs=( $( scselect |& \
              perl -lne 'next if/^\S/;/\(([^)]+)\)/&&print qq{"$1"}' ) )
    _arguments -C "*:Network Location Set:($locs)"
}

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.