我正在做一个bash脚本,它可以自动为我运行模拟。为了开始模拟,这个其他脚本需要一个输入,它应该由文件夹的名称决定。从文件名中提取数字
所以,如果我有一个文件夹名称No200,那么我想提取数200到目前为止,我有什么是
PedsDirs=`find . -type d -maxdepth 1`
for dir in $PedsDirs
do
if [ $dir != "." ]; then
NoOfPeds = "Number appearing in the name dir"
fi
done
非常感谢。 –