This is the mail archive of the
cygwin
mailing list for the Cygwin project.
RE: Bash: Cannot execute binary file
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