Use -d '\n'
com o comando xargs
:
cat file | xargs -d '\n' -l1 mkdir
Da página de manual:
-d delim
Input items are terminated by the specified character. Quotes and backslash are not special; every
character in the input is taken literally. Disables the end-of-file string, which is treated like any
other argument. This can be used when the input consists of simply newline-separated items, although
it is almost always better to design your program to use --null where this is possible. The specified
delimiter may be a single character, a C-style character escape such as \n, or an octal or hexadecimal
escape code. Octal and hexadecimal escape codes are understood as for the printf command. Multibyte
characters are not supported.
Exemplo de saída:
$ ls
file
$ cat file
Long Name One (001)
Long Name Two (201)
Long Name Three (123)
$ cat file | xargs -d '\n' -l1 mkdir
$ ls -1
file
Long Name One (001)
Long Name Three (123)
Long Name Two (201)