Get the absolute path of a file in a folder

#!/bin/bash -l

path=`find $(pwd) -name *.ipa`

echo ${path}


It is also possible to write the following

path=$(find $(pwd) -name *.ipa)

Please add a picture description
As shown in the figure, there is an .ipa file under the Export folder, and we currently want to obtain the absolute path of the .ipa file
Please add a picture description

The execution results are as follows

192:Jenkins liubo$ cd /Users/liubo/Desktop/Jenkins/Export 
192:Export liubo$ sh /Users/liubo/Desktop/kk_副本.sh 
/Users/liubo/Desktop/Jenkins/Export/ThePaperBase_20230619-22-29-34_IPA/ThePaperBase.ipa
192:Export liubo$ 

Guess you like

Origin blog.csdn.net/LIUXIAOXIAOBO/article/details/131315952