shell讀取abc.txt文件,每行是一個文件夾名,文件夾名字長32個字符,
因為abc.txt讀取到每行都有\r和其他字符結尾,故用line=${line:0:32}只取到文件名。
該腳本實現從html目錄挑選出名稱在abc.txt里文件夾到out目錄
#!/bin/bash while read line do echo "line:"$line line=${line:0:32} cp -rf "html/"${line} out/ done <abc.txt
shell讀取abc.txt文件,每行是一個文件夾名,文件夾名字長32個字符,
因為abc.txt讀取到每行都有\r和其他字符結尾,故用line=${line:0:32}只取到文件名。
該腳本實現從html目錄挑選出名稱在abc.txt里文件夾到out目錄
#!/bin/bash while read line do echo "line:"$line line=${line:0:32} cp -rf "html/"${line} out/ done <abc.txt
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。