Bash seg faulting?
Andy Hall
fixpertise-consulting@comcast.net
Fri Jun 2 00:01:00 GMT 2017
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
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"
done
$cat conv.bat
@echo off
set OFFICE_BIN=C:\Program Files (x86)\Microsoft Office\root\Office16
for %%a in ("*.doc") do (
rem This is necessary because *.doc can match *.docx! Need to check the actual extension.
if "%%~xa" == ".doc" (
echo "converting: %%a"
"%OFFICE_BIN%\Wordconv.exe" -oice -nme "%%a" "%%ax"a
)
)
When conv.sh is run on a directory containing three .doc files, the conversions work but I get three seg faults at three
different locations. E.g.
$ conv.sh
converting: Post-Install.doc
./conv.sh: line 5: 6060 Segmentation fault "$OFFICE_BIN"/Wordconv.exe -oice -nme "$doc" "${doc}x"
converting: Post-InstallB.doc
./conv.sh: line 5: 13264 Segmentation fault "$OFFICE_BIN"/Wordconv.exe -oice -nme "$doc" "${doc}x"
converting: Post-InstallTest.doc
./conv.sh: line 5: 13260 Segmentation fault "$OFFICE_BIN"/Wordconv.exe -oice -nme "$doc" "${doc}x"
When conv.bat is run in the same directory, the conversions work and I don't get any seg faults (or they are not being
reported!) E.g.
$ conv.bat
"converting: Post-Install.doc"
"converting: Post-InstallB.doc"
"converting: Post-InstallTest.doc"
Now Wordconf.exe is a 32-bit executable running on a Windows 10 Pro 64-bit installation.
My cygcheck.out is attached. I guess I can get an strace if need.
Andy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out
Type: application/octet-stream
Size: 22508 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20170602/58f1ecee/attachment.obj>
-------------- next part --------------
--
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
More information about the Cygwin
mailing list