|
|
As an alias...
In trying to sort through a similar hint submitted by Kevin B., we were having some trouble making versions of these aliases function on my machine. After much back and forth, Kevin came up with a quoting technique that worked for me. Applied to the above command, it looks like this:
% alias kdock kill '`'"ps -acx | grep Dock$ | awk '{print "\$1"}'"'`'If you add this to your alias file, then a simple "kdock" will kill the Dock upon request.
-rob.
As an alias...
An even better version, which is a slightly modified version of the hint I actually submitted, is the following:
alias kdock kill '`'"ps -xaco pid,command |
egrep -x '[[:space:]]*[[:digit:]]+ Dock' | awk '{print "\\$1"}'"'`'
(split into 2 lines for easier viewing)
This will match only the dock and nothing else, whereas the other 2 methods could match something that's just similarly named.
As an alias...
Gah! The dreaded slashes bug strikes again! The preview made it look correct, but the submission had an extra slash. I'll attempt to post the code again. If it doesn't work, just remember that it's supposed to be one slash before the $1.
alias kdock kill '`'"ps -xaco pid,command |
egrep -x '[[:space:]]*[[:digit:]]+ Dock' | awk '{print "\$1"}'"'`'
(split into 2 lines for easier viewing)
|
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.08 seconds |
|