mkdir.sh Syntax error: word unexpected (expecting "do")

sh/bash/dash/ksh/zsh等Shell脚本
回复
ayading826
帖子: 15
注册时间: 2012-10-23 16:09
系统: win7/linux
送出感谢: 2 次
接收感谢: 0

mkdir.sh Syntax error: word unexpected (expecting "do")

#1

帖子 ayading826 » 2013-03-26 18:37

mkdir.sh

执行 sh mkdir.sh xxx(参数)
错误提示:mkdirs.sh: 9: Syntax error: word unexpected (expecting "do")
请问有谁知道为什么吗?

root@ubuntu10:~# cat mkdirs.sh
#!/bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Last modified: 1994-03-25
# Public domain
#
errstatus=0
for file in ${1+"$@"};do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d in ${1+"$@"} ; do
pathcomp="$pathcomp$d"
case "$pathcomp" in
-