www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/09/24/08:46:03

Date: Tue, 24 Sep 1996 14:43:44 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: djgpp-workers AT delorie DOT com
Cc: Hans-Bernhard Broeker <Broeker AT axp03 DOT physik DOT rwth-aachen DOT de>
Subject: Problems with `ms_sh'
Message-Id: <Pine.SUN.3.91.960924143229.11882G-100000@is>
Mime-Version: 1.0

To test the latest port of Make with a unixy shell, I took some typical
Unix Makefiles and tried to run some of their targets.  This is when I 
stumbled upon weird problems with `ms_sh'.  For some, seemingly naive 
scripts it begins to spill garbage halfway through the script.  For 
example, the script below should create a list of directories (you can 
find some such in almost every GNU package).  But when I invoke it, even 
from the DOS prompt, it begins to create directories with garbled names 
after making some of them correctly.  For instance, if I invoke it like 
so:

	sh ./mkinstalldirs xtest/bin xytest/info xytest/man/man1

it creates xtesty/bin and xtest/info, but then tries to create a 
directory whose name is made of characters with ASCII code above 128.  It 
seemed to me, although I'm not sure, that deleting some variables from 
the environment helps the script to run correctly.  (I have a 1.5KB-long 
environment, with about 800 bytes of it used up.)  However, running 
`ms_sh' after enlarging the environment to 4KB didn't help at all.

Does anybody know about specific hints to set up ms_sh?  Did anybody see 
any of the problems described above?  I cannot move further in my testing 
without being able to run arbitrary complex scripts.  Thanks.

Here is the script:

#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman AT prep DOT ai DOT mit DOT edu>
# Created: 1993-05-16
# Public domain

# $Id: mkinstalldirs,v 1.10 1996/05/03 07:37:52 friedman Exp $

errstatus=0

for file
do
   set fnord `echo ":$file" | sed -ne 's,^:/,#,;s,^:,,;s,/, ,g;s,^#,/,;p'`
   shift

   pathcomp=
   for d
   do
     pathcomp="$pathcomp$d"
     case "$pathcomp" in
       -* ) pathcomp=./$pathcomp ;;
     esac

     if test ! -d "$pathcomp"; then
        echo "mkdir $pathcomp" 1>&2

        mkdir "$pathcomp" || lasterr=$?

        if test ! -d "$pathcomp"; then
  	  errstatus=$lasterr
        fi
     fi

     pathcomp="$pathcomp/"
   done
done

exit $errstatus

# mkinstalldirs ends here


	

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019