I would like to create files from the following list.
There is no problem if the list doesn't have a space ... but the problem is it has a space
user@linux:~$ cat file.txt
Apples
Bing Cherry
Crab Apples
Dragon Fruit
user@linux:~$
Before
ser@pc:~$ ls -l
total 4
-rw-r--r-- 1 user user 44 Jun 9 14:06 file.txt
user@linux:~$
xargs touch
user@linux:~$ cat file.txt | xargs touch
user@linux:~$
Instead of creating Apples, Bing Cherry, Crab Apples, Dragon Fruit
, the command producing these output.
After
user@linux:~$ ls -l
total 4
-rw-r--r-- 1 user user 0 Jun 9 14:11 Apples
-rw-r--r-- 1 user user 0 Jun 9 14:11 Bing
-rw-r--r-- 1 user user 0 Jun 9 14:11 Cherry
-rw-r--r-- 1 user user 0 Jun 9 14:11 Crab
-rw-r--r-- 1 user user 0 Jun 9 14:11 Dragon
-rw-r--r-- 1 user user 44 Jun 9 14:06 file.txt
-rw-r--r-- 1 user user 0 Jun 9 14:11 Fruit
user@linux:~$
What should I do to handle space in this situation?