- 论坛徽章:
- 0
|
# ls -l
dr-xr-xr-x. 2 root root 4096 Jan 20 04:23 bin
dr-xr-xr-x. 4 root root 4096 Mar 15 19:48 boot
drwxr-xr-x 18 root root 4020 Mar 18 21:31 dev
drwxr-xr-x. 124 root root 12288 Mar 19 03:50 etc
drwxr-xr-x. 5 root root 4096 Mar 18 17:40 home
dr-xr-xr-x. 13 root root 4096 Jan 6 04:13 lib
dr-xr-xr-x. 10 root root 12288 Mar 16 03:45 lib64
drwx------. 2 root root 16384 Jan 6 00:35 lost+found
drwxr-xr-x. 2 root root 4096 Sep 23 2011 media
$my_string = `ls -l`;
@all_files;
我想从$my_string这里得到所有文件名(bin boot dev etc home这些),赋值给@all_files这个数组,该怎么做?
thanks in advance |
|