This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Newbie Questions
- From: Andrey Repin <anrdaemon at yandex dot ru>
- To: Mike Rushton <mrushton at ptd dot net>, cygwin at cygwin dot com
- Date: Thu, 6 Feb 2014 02:16:36 +0400
- Subject: Re: Newbie Questions
- Authentication-results: sourceware.org; auth=none
- References: <1898639722 dot 6893470 dot 1391541591920 dot JavaMail dot root at ptd dot net> <52F153AE dot 5080704 at gmail dot com> <52F28215 dot 5030801 at ptd dot net> <52F28330 dot 6060101 at cygwin dot com> <52F2AA5D dot 4000000 at etr-usa dot com> <52F2B0BC dot 70806 at ptd dot net>
- Reply-to: Andrey Repin <cygwin at cygwin dot com>
Greetings, Mike Rushton!
> Right ... the extension is a windows thing.
Not really. It's a human thing, that let you tell the intended meaning of the
file at a glance.
> Most of the bourne shell scripts i have come across have no extension.
> Some have the Shebang line ... while others don't have it.
Ones that not have it are scripts not intended for direct invocation (like
these normally residing in /etc/default/*)
> I am still in the planing stages ... I am not sure if I am going to use
> an extension or not.
> It might be a good idea to use .sh and then you would know that it is a
> script.
I'm using this little wrapper to start scripts by shebang line.
-->8-------->8-------->8-------->8-------->8-------->8-------->8------
C:\Programs\CygWin\bin\cygwrap.sh
#! /bin/sh
if [ -z "$1" ]; then
echo "No command given, breaking off." 1>&2
exit 1
fi
CMDNAME="$( cygpath -au "$1")"
shift
env "$CMDNAME" $*
-->8-------->8-------->8-------->8-------->8-------->8-------->8------
along with association
$ assoc .pl
.pl=unixshell.script
$ assoc .sh
.sh=unixshell.script
(etc.)
$ ftype unixshell.script
unixshell.script="C:\Programs\Cygwin\bin\env.exe" /bin/cygwrap.sh "%1" %*
--
WBR,
Andrey Repin (anrdaemon@yandex.ru) 06.02.2014, <02:08>
Sorry for my terrible english...
--
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