script_dir=$(dirname "$0")
file_path=$(dirname "$0")"/file.txt"
parent_dir=$(dirname "/path/to/child/directory")
for file in $(ls $(dirname "$0"))
do
echo $file
done
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读:echo命令在shell脚本中的应用技巧