public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Andrey Repin <anrdaemon@yandex.ru>
To: All <cygwin@cygwin.com>
Subject: Small wrapper to start Cygwin scripts by unix name
Date: Wed, 06 Nov 2013 17:20:00 -0000	[thread overview]
Message-ID: <16910539373.20131106211846@mtu-net.ru> (raw)

[-- Attachment #1: Type: text/plain, Size: 672 bytes --]

Greetings, All!

I was using a simple

[C:\]$ ftype unixshell.script
unixshell.script="C:\Programs\Cygwin\bin\env.exe" "%1" %*

association to run Cygwin scripts, until I've discovered, that, say, gawk is
unable to digest native path to script.

Had to thinker around it, but original idea to have native batch file was
unsuccessful. Probably because of local issues, but I wanted to run that AWK
script... So I came up with a Cygwin wrapper and expanded association:

[C:\]$ ftype unixshell.script
unixshell.script="C:\Programs\Cygwin\bin\env.exe" /bin/cygwrap.sh "%1" %*


-- 
WBR,
Andrey Repin (anrdaemon@yandex.ru) 06.11.2013, <20:54>

Sorry for my terrible english...

[-- Attachment #2: cygwrap.sh --]
[-- Type: application/octet-stream, Size: 147 bytes --]

#! /bin/sh
if [ -z "$1" ]; then
  echo "No command given, breaking off." 1>&2
  exit 1
fi

CMDNAME="$( cygpath -au "$1")"
shift

env "$CMDNAME" $*

[-- Attachment #3: Type: text/plain, Size: 218 bytes --]

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

                 reply	other threads:[~2013-11-06 17:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16910539373.20131106211846@mtu-net.ru \
    --to=anrdaemon@yandex.ru \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).