dirname
and basename
are the tools you're looking for for extracting path components:
$ export VAR='/home/pax/file.c' $ echo "$(dirname "${VAR}")" ; echo "$(basename "${VAR}")" /home/pax file.c
$>basename a.pgp .pgp a
ZhangZhihui's Blog |
|
||
Copyright © 2024 ZhangZhihuiAAA
Powered by .NET 9.0 on Kubernetes |