delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/06/03/23:40:22

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_28,SPF_PASS
X-Spam-Check-By: sourceware.org
From: Haojun Bao <baohaojun AT gmail DOT com>
To: cygwin AT cygwin DOT com
Subject: of and oc
Date: Thu, 04 Jun 2009 11:40:08 +0800
Message-ID: <831vq08y5j.fsf@gmail.com>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.94 (windows-nt)
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

cygstart is so useful that I want type less keys:

    alias of=cygstart #on cygwin-1.5

or:

    function of ()
    {
        if which "$1" > /dev/null 2>&1; then
            if [[ "$1" == of ]]; then
                local file=`which cygstart`;
            else
                local file="`which \"$1\"`";
            fi;
            shift;
            cygstart "$file" "$@";
        else
            cygstart "$@";
        fi
    } #on cygwin-1.7, because we must specify full path now

oc is my name for `open containing folder', and I peeked into source of
Firefox to write it:

    function oc ()
    {
        cygstart `which explorer.exe` /n,/select,\""`cygpath -alw \"$1\"`"\"
    }
    
It won't work for non-ascii file names though, as a Chinese, I feel
a bit sorry for that

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019