It sounds like you want the basename of the dirname: $ filepath=/a/b/c/d/file $ parentname="$(basename "$(dirname "$filepath")")" $ echo ...
確定! 回上一頁