shell脚本输出文件夹下所有目录的绝对路径

1 #!/bin/bash
  2
  3 test_path= /alidata/myfile
  4 for i in $(ls $test_path)
  5
  6 do
  7 echo $i
  8 pwd echo $test_path/$i
  9 done


[root@iZ9488z4qfcZ test]# ./test.sh
./test.sh: line 3: /alidata/myfile: is a directory
for.sh
/alidata/myfile/test
hello.sh
/alidata/myfile/test
name.sh
/alidata/myfile/test
test.sh
/alidata/myfile/test
www
/alidata/myfile/test


你可能感兴趣的:(linux笔记)