DATA_DIR=/home/liupan/.navinsight/gm result="" for i in $(ls -a $DATA_DIR) do if [ $i != "." -a $i != ".." ] then result=$result$i"," fi done echo $result
该代码将data_dir下的所有文件夹的名字拼接成以逗号分隔的字符串
DATA_DIR=/home/liupan/.navinsight/gm result="" for i in $(ls -a $DATA_DIR) do if [ $i != "." -a $i != ".." ] then result=$result$i"," fi done echo $result
该代码将data_dir下的所有文件夹的名字拼接成以逗号分隔的字符串