色婆ijqwj 发表于 2018-8-22 09:46:33

查看文件及目录-shell学习

for file in "$@"; do  thisfile=${thisfile:-$PWD}/$file
  if [ -d "$thisfile" ]; then
  if [ $count -eq 1 ]; then
  echo -e $line$file/
  #echo -e "end!"
  tab=${tab%"$singletab"}"\t"
  redir $(ls $thisfile)
  else
  echo -e $line$file/
  #echo -e "this is directory!"
  redir $(ls $thisfile)
  fi
  else
  echo -e $line$file
  #echo -e"this is a file,you can do anything you want!"/
  fi
  thisfile=${thisfile%/*}
  let count=count-1
  done

页: [1]
查看完整版本: 查看文件及目录-shell学习