shell script取得指定資料夾下的資料夾 - Linux

Table of Contents


我想要再shell script下取得指定資料架下的資料夾名稱(並且存在變數中)

只要單一一層就好

有想到用find指令,但是不知道要怎麼把他存在變數下

謝謝~~~

--

All Comments

Kama avatarKama2012-05-30
目的? 如果是script要用的話,可以for d in */ 這樣
Dorothy avatarDorothy2012-05-31
DIRS=`find ./ -maxdepth 1 -type d` 注意是backqoute(`)