Try touch `ls -1`
On 15 Oct 2016, at 19:33, Carl Hoefs <newsli...@autonomy.caltech.edu> wrote:
> Yeah, that's what I thought at first, too. But touch begs to differ:
> $ ls -1 | sort | touch
> touch [-A [-][[hh]mm]SS] [-acfhm] [-r file] [-t [[CC]YY]MMDDhhmm[.SS]] file
>> On Oct 15, 2016, at 7:31 PM, Macs R We <macs...@macsrwe.com> wrote:
>> Right off the bat, I think you made a mistake in putting the * at the end of
>> the command. The whole idea of piping the output from LS is to input it to
>> touch, and you just provided touch with another argument first. I think if
>> you just let LS do its job and don't provide touch any arguments, you will
>> get what you want, including all of the necessary requoting.
>>> On Oct 15, 2016, at 7:24 PM, Carl Hoefs <newsli...@autonomy.caltech.edu>
>>> I'm trying to arrange the files in a directory to have modification dates
>>> according to alphabetical sort order. (Sounds weird, but Alpine car units
>>> use modification date as the ordering of music tracks on a USB stick.)
>>> In bash I'm using:
>>> ls -1 | sort | touch *
>>> ...but it doesn't work, there is no change in the modification date of the
>>> files. I'm guessing the problem is that the filenames have spaces, so the
>>> 'touch *' is only touching the first word of the filename.
>>> Is there a way to do this?
>>> MacOSX-talk mailing list
> MacOSX-talk mailing list
David P Henderson
"Human beings are unable to be honest with themselves about themselves. They
cannot talk about themselves without embellishing."
-- Akira Kurosawa
MacOSX-talk mailing list