Try touch `ls -1`
On 15 Oct 2016, at 19:33, Carl Hoefs wrote:
> Yeah, that's what I thought at first, too. But touch begs to differ:
>
> $ ls -1 | sort | touch
> usage:
> touch [-A [-][[hh]mm]SS] [-acfhm] [-r file] [-t [[CC]YY]MMDDhhmm[.SS]] file
> ...
>
> -Carl
>
>
>> On Oct 15, 2016, at
In order to use a pipe with touch, you'd need to move the pipe
contents over to the argument list. This is where xargs comes in.
ls | sort | xargs touch
Tip: you can omit the '-1' as that's the default when you're redirecting output.
Other options as suggested are:
touch `ls`
or
touch $(ls)
B