www.delorie.com/archives/browse.cgi | search |
X-Spam-Check-By: | sourceware.org |
From: | "jgriffin" <jgriffin AT pclnet DOT net> |
To: | cygwin AT cygwin DOT com |
Subject: | Paths and Cygwin |
Date: | Thu, 9 Feb 2006 08:58:40 -0600 |
Message-Id: | <20060209145338.M55639@pclnet.net> |
X-OriginatingIP: | 199.209.144.110 (jgriffin) |
MIME-Version: | 1.0 |
X-Mail.PCLNET.NET-MailScanner-Information: | Please contact the ISP for more information |
X-Mail.PCLNET.NET-MailScanner: | Not scanned: please contact your Internet E-Mail Service Provider for details |
X-Mail.PCLNET.NET-MailScanner-SpamCheck: | not spam, SpamAssassin (score=-3.3, required 7, autolearn=not spam, ALL_TRUSTED -3.30) |
X-Mail.PCLNET.NET-MailScanner-From: | jgriffin AT pclnet DOT net |
X-pclnet.net-MailScanner-Information: | Please contact the ISP for more information |
X-pclnet.net-MailScanner: | Found to be clean |
X-pclnet.net-MailScanner-From: | jgriffin AT pclnet DOT net |
X-IsSubscribed: | yes |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
I'm trying to run this script: ----------------mkdirhier.sh start------------------- newline=' ' IFS=$newline case ${1--} in -*) echo >&2 "mkdirhier: usage: mkdirhier directory ..."; exit 1 esac status= echo $directory for directory do case $directory in '') echo >&2 "mkdirhier: empty directory name" status=1 continue;; *"$newline"*) echo >&2 "mkdirhier: directory name contains a newline: \`\`$directory''" status=1 continue;; ///*) prefix=/ echo prefix: $prefix;; # See Posix 2.3 "path". //*) prefix=// echo prefix: $prefix;; /*) prefix=/ echo prefix: $prefix;; -*) prefix=./ echo prefix: $prefix;; *) prefix= echo prefix: $prefix;; esac IFS=/ set x $directory case $2 in */*) # IFS parsing is broken IFS=' ' set x `echo $directory | tr / ' '` ;; esac IFS=$newline shift for filename do path=$prefix$filename prefix=$path/ shift test -d "$path" || { paths=$path for filename do if [ "$filename" != "." ]; then path=$path/$filename paths=$paths$newline$path fi done mkdir $paths || status=$? break } done done exit $status ----------------mkdirhier.sh end-------------------- Input: ./mkdirhier.sh "/home/jgriffin/test/level1/level2" >& out.txt Here's the output: prefix: / mkdir: cannot create directory `//home': No such file or directory mkdir: cannot create directory `//home/jgriffin': No such host or network path mkdir: cannot create directory `//home/jgriffin/test': No such host or network path mkdir: cannot create directory `//home/jgriffin/test/level1': No such host or network path mkdir: cannot create directory `//home/jgriffin/test/level1/level2': No such host or network path Why does Cygwin append a extra backslash to the path? Thanks, Joseph -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |