Skip to content

Extend 'test' with non-POSIX file time comparison extensions #3589

Closed
@floam

Description

@floam

These non-POSIX extensions are pretty popular and commonly used. I can't see the harm in making it easier to do file date comparisons with fish using test.

     file1 -nt file2
                   True if file1 exists and is newer than file2.
     file1 -ot file2
                   True if file1 exists and is older than file2.

At least on OS X, these are the other operations the system test can do that aren't POSIX, according to the manpage. Fish already supports -O and -G.

     file1 -ef file2
                   True if file1 and file2 exist and refer to the same file.

     -O file       True if file exists and its owner matches the effective user id of this process.

     -G file       True if file exists and its group matches the effective group id of this process.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions