아시다시피 list=$(ls -l)
추가된 모든 파일을 작성하면 $list
다음과 같습니다.
total 0 drwx------ 7 mine-pc staff 238 Dec 22 11:32 Applications drwxr-xr-x@ 6 mine-pc staff 204 Jan 11 11:00 Applications (Parallels) drwx------+ 21 mine-pc staff 714 Jan 9 22:33 Desktop drwx------+ 33 mine-pc staff 1122 Jan 7 23:43 Documents drwx------+ 83 mine-pc staff 2822 Jan 11 00:42 Downloads drwx------@ 71 mine-pc staff 2414 Dec 22 01:10 Library drwx------+ 21 mine-pc staff 714 Jan 10 23:48 Movies drwx------+ 4 mine-pc staff 136 Sep 27 17:48 Music drwxr-xr-x 5 mine-pc staff 170 Jan 4 16:25 Parallels drwx------+ 9 mine-pc staff 306 Dec 29 13:06 Pictures drwxr-xr-x+ 5 mine-pc staff 170 Sep 27 15:41 Public
$list
다음과 같이 삽입하려면 어떻게 해야 합니까 ?
drwx------ 7 mine-pc staff 238 Dec 22 11:32 Applications
drwxr-xr-x@ 6 mine-pc staff 204 Jan 11 11:00 Applications (Parallels)
drwx------+ 21 mine-pc staff 714 Jan 9 22:33 Desktop
drwx------+ 33 mine-pc staff 1122 Jan 7 23:43 Documents
drwx------+ 83 mine-pc staff 2822 Jan 11 00:42 Downloads
drwx------@ 71 mine-pc staff 2414 Dec 22 01:10 Library
drwx------+ 21 mine-pc staff 714 Jan 10 23:48 Movies
drwx------+ 4 mine-pc staff 136 Sep 27 17:48 Music
drwxr-xr-x 5 mine-pc staff 170 Jan 4 16:25 Parallels
drwx------+ 9 mine-pc staff 306 Dec 29 13:06 Pictures
drwxr-xr-x+ 5 mine-pc staff 170 Sep 27 15:41 Public
답변1
$list
이미 이런 형식으로 되어있습니다. 따옴표 사용:
echo "$list"