public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Small wrapper to start Cygwin scripts by unix name
@ 2013-11-06 17:20 Andrey Repin
  0 siblings, 0 replies; only message in thread
From: Andrey Repin @ 2013-11-06 17:20 UTC (permalink / raw)
  To: All

[-- 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-11-06 17:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-06 17:20 Small wrapper to start Cygwin scripts by unix name Andrey Repin

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).