Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
入力としてファイル パスを取り、絶対ファイル パスを返す bash コマンドはありますか? より具体的には、次のようなパスを入力として受け取るコマンドが必要です。
/tmp/yaneeve/kit/linux/../../output/kit/SOURCES//usr//apps/myapp/lib
パスを返します。
/tmp/yaneeve/output/kit/SOURCES/usr/apps/myapp/lib
ありがとう!
パスが存在する場合は、(Linux上でも)はるかに信頼性の高いポータブルな方法があります。
canonicalPath=$(cd "$path"; pwd)
試す (Linux)
readlink -f