public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Buchbinder, Barry (NIH/NIAID) [E]" <BBuchbinder@niaid.nih.gov>
To: "cygwin@cygwin.com" <cygwin@cygwin.com>,
	"'moss@cs.umass.edu'"	<moss@cs.umass.edu>
Subject: RE: Bash: Cannot execute binary file
Date: Tue, 29 Mar 2011 09:12:00 -0000	[thread overview]
Message-ID: <0105D5C1E0353146B1B222348B0411A209E396A241@NIHMLBX02.nih.gov> (raw)
In-Reply-To: <4D914393.5090409@cs.umass.edu>

Eliot Moss sent the following at Monday, March 28, 2011 10:28 PM
>Why not just use the Windows version and invoke it from cygwin (if
>cygwin is the environment from which you want to do that)? It is easy
>to invoke Windows programs from cygwin; you just need to remember to
>format any arguments in the form the Windows program wants. To that end,
>cygpath is a useful utility, e.g.:
>
>function acrobat () { }
>   command acrobat $(cygpath -wa ${1})
>}
>
>in your .bashrc file allows you to invoke Windows acrobat with a path
>rewritten from cygwin format to Windows format. This can be improved to
>check for presence of the argument ${1}, etc., but perhaps you get the
>idea.

- You should probably also add some quotes, in case your paths have spaces.
- A complete path to acrobat will avoid needing to have it in your path.
- Using cygstart will get you back to your command prompt.

function acrobat () {
    if [ -f "${1}" ]
    then
        cygstart '/path/acrobat' "$(cygpath -wa "${1}")"
    else
        echo "error: file `${1}' not found!"
    fi
}

Note:  I have not tested the above.  Debugging is left as an exercise for
the user.

- You also might look at cyg-wrapper.sh, found here:
    http://hermitte.free.fr/cygwin/
  Note:  I don't use it so YMMV.

Good luck.

- Barry
  Disclaimer: Statements made herein are not made on behalf of NIAID.


--
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:[~2011-03-29  3:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-29  1:34 independentt
2011-03-29  1:37 ` Eliot Moss
2011-03-29  1:42   ` independentt
2011-03-29  1:53     ` Eliot Moss
2011-03-29  1:38 ` Christopher Faylor
2011-03-29  2:28   ` independentt
2011-03-29  3:19     ` Christopher Faylor
2011-03-29  8:40       ` Eliot Moss
2011-03-29  9:12         ` Buchbinder, Barry (NIH/NIAID) [E] [this message]
2011-08-27  5:55           ` srinu
2011-08-27  8:08             ` Marco atzeri
2011-08-27  8:17             ` Jens Schweikhardt

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=0105D5C1E0353146B1B222348B0411A209E396A241@NIHMLBX02.nih.gov \
    --to=bbuchbinder@niaid.nih.gov \
    --cc=cygwin@cygwin.com \
    --cc=moss@cs.umass.edu \
    /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).