我正在尝试使用数组来使用该find
命令存储文件名列表.
由于某些原因,该阵列无法在学校使用的bash中工作,我的程序在我自己的笔记本电脑上工作.
所以我想知道是否有另一种方法可以做到这一点,这就是我所拥有的:
array = (`find . -name "*.txt"`) #this will store all the .txt files into the array
Run Code Online (Sandbox Code Playgroud)
然后我可以使用cat命令访问数组项并复制所有文件.
有没有其他方法可以不使用数组?
(10)
/ \
(9) (8)
/ \ / \
(7) (5) (4)
x x
/ and \ == x=>y
y y
Run Code Online (Sandbox Code Playgroud)