public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Jack Adrian Zappa <adrianh.bsc@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Bash seg faulting?
Date: Fri, 02 Jun 2017 16:11:00 -0000	[thread overview]
Message-ID: <CAKepmaizt+cqc9T+hSB-vAt6XthGszgO-ALrwaf1r1AnXf2YSA@mail.gmail.com> (raw)
In-Reply-To: <002201d2dbb8$45646b00$d02d4100$@comcast.net>

How about using -xv on your first line to see what is actually being
executed when doing substitution?

I.e.
#!/bin/bash -xv

Another possibility is that Wordconv.exe requires .DLLs that are not
found in the path.

HTH


A

On Fri, Jun 2, 2017 at 11:52 AM, Andy Hall
<fixpertise-consulting@comcast.net> wrote:
> On 1 June Doug Henderson wrote:
>>
>> On 1 June 2017 at 18:01, Andy Hall wrote:
>> >
>> > Here is a strange one.   I have two scripts, conv.sh and conv.bat that do the same thing: scan the current directory for
>> > .doc files and convert them to .docx files.  Here are the two scripts.
>> >
>> > $ cat conv.sh
>> > #!/bin/bash
>> >
>>
>> Try running "cat -e conv.sh" to see if you have dos line endings, e.g.
>> CR LF, instead of unix line endings, e.g. LF only.
>>
>> If you do, run "dos2unix conv.sh" or "d2u conv.sh" to fix the line
>> ending problem. Check that your editor can create files with unix line
>> endings, and preserves unix line endings.
>>
>> HTH
>> Doug
>>
> First of all, the Wordconv.exe converts a .doc file to a .docx file, ostensible writing no output.   However, I find if I change the script to read:
>
> #!/bin/bash
>
> OFFICE_BIN="C:\Program Files (x86)\Microsoft Office\root\Office16"
>
> for doc in *.doc; do
>         echo "converting: $doc"
>         "$OFFICE_BIN"/Wordconv.exe -oice -nme "$doc" "${doc}x" | od
> done
>
> and run, I don’t get the seg faults, but od is showing no output written as you might expect (as in od <dev/null).
>
> $ conv.sh
> converting: Post-Install.doc
> 0000000
> converting: Post-InstallB.doc
> 0000000
> converting: Post-InstallTest.doc
> 0000000
>
> So something is strange about this particular .exe being executed from bash.  (Remember that the .bat version of conv.sh does not seg fault.
>
> Sending the output of od to /dev/null silences the seg fault and spurious output; provoding a workaround.
>
>
>
>
>
>
>
>
>
>
>
> --
> 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
>

--
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:[~2017-06-02 16:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-02  0:01 Andy Hall
2017-06-02  1:50 ` Doug Henderson
2017-06-02 15:52   ` Andy Hall
2017-06-02 16:11     ` Jack Adrian Zappa [this message]
2017-06-02 21:57 Andy Hall

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=CAKepmaizt+cqc9T+hSB-vAt6XthGszgO-ALrwaf1r1AnXf2YSA@mail.gmail.com \
    --to=adrianh.bsc@gmail.com \
    --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).