日期:2014-05-16  浏览次数:20765 次

求代码解释
#!/bin/sh

h=`sort ../busybox.links | uniq`
prefix=$PWD

for i in $h; do
  appdir=`dirname $i`  
  mkdir -p $prefix/$appdir || exit 1  
  case "$appdir" in
  /)
  bb_path="bin/busybox"
  ;;
  /bin)
  bb_path="busybox"
  ;;
  /sbin)
  bb_path="../bin/busybox"
  ;;
  /usr/bin|/usr/sbin)
  bb_path="../../bin/busybox"
  ;;
  *)
  echo "Unknown installation directory: $appdir"
  exit 1
  ;;
  esac
  if [ ! -e "$prefix$i" ]; then
  ln -fs $bb_path $prefix$i || exit 1
  else
  echo " $prefix$i already exists"
  fi
done

上面的代码中for循环里面的代码不是很理解,请大家帮我解释一下啊。

先谢谢大家了

------解决方案--------------------
sh -x yourshell
执行时会显示具体的命令
------解决方案--------------------
看Shell编程吧,都有
------解决方案--------------------
好像毫无难度。