From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 976 invoked by alias); 2 Jun 2017 16:11:43 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 958 invoked by uid 89); 2 Jun 2017 16:11:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM,KAM_LINEPADDING,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=unsubscribe-simple, unsubscribesimple, office, Office X-HELO: mail-oi0-f54.google.com Received: from mail-oi0-f54.google.com (HELO mail-oi0-f54.google.com) (209.85.218.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 02 Jun 2017 16:11:40 +0000 Received: by mail-oi0-f54.google.com with SMTP id s3so7001134oia.0 for ; Fri, 02 Jun 2017 09:11:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-transfer-encoding; bh=hDg9+xdirAY/09+yzncgH0JUIcRx7O9PEFqDSj8Y93I=; b=MIEsEKYok8o6KE00PXmptOuiuK0TuWYdSIEdF2QTQAqej/f1dBvuEd7oCY9RosKq14 myiRzt3Vsqbf6kPUVCWrs8vRYJZBTiJPcumiqrfmUjEqAQu7TikjHPwSRFGD3Z1+4ZTQ rft5x+drmXR7VtZ27aTrtkw3+VEuI8IxURvVpOnUZtX/HH143HIi37Aeo78oN7ARDlL+ WQ0gJ4nwClkQRRTufVVgNk5/mneAC4XrIwGXpc7yklvZMXIfME0sVyiUlpqClKkETq5k KpJlfh9HoKPzSkVGTlrgD1v0JWfFl2ZgvbZMyMSReRNIXlC9sNo8lOA0VK543ogiHbVr PEVQ== X-Gm-Message-State: AODbwcDHaYHR5bltBoPlNFsT6Dcb7W/gXise1i3PtAe16gfeF6xUM906 pTAl4abEzRN/nOUPpfpaWYETvJRgig== X-Received: by 10.157.46.11 with SMTP id q11mr5298251otb.129.1496419902918; Fri, 02 Jun 2017 09:11:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.14.194 with HTTP; Fri, 2 Jun 2017 09:11:42 -0700 (PDT) In-Reply-To: <002201d2dbb8$45646b00$d02d4100$@comcast.net> References: <001801d2db33$5a560e90$0f022bb0$@comcast.net> <002201d2dbb8$45646b00$d02d4100$@comcast.net> From: Jack Adrian Zappa Date: Fri, 02 Jun 2017 16:11:00 -0000 Message-ID: Subject: Re: Bash seg faulting? To: cygwin@cygwin.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg00011.txt.bz2 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 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, oste= nsible writing no output. However, I find if I change the script to read: > > #!/bin/bash > > OFFICE_BIN=3D"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=E2=80=99t get the seg faults, but od is showing no output = written as you might expect (as in od > $ 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 ba= sh. (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