如何用根路径解析相对路径

时间:2019-07-03 03:28:12

标签: macos unix path gnu-findutils find-util

我有这个:

for f in `(cd "$project_root/src" && find . -type f)`; do
    full_src="$project_root/src/$f";
    full_dist="$project_root/dist/$f";

    echo "Full src: $full_src";
    echo "Full dist: $full_dist";
done

我得到:

Full src: /Users/alex/codes/interos/interos-cli/src/./declarations.ts
Full dist: /Users/alex/codes/interos/interos-cli/dist/./declarations.ts

我该如何解析文件路径,以便删除多余的./

0 个答案:

没有答案