perlancar

NAME

relpath - Return the relative pathname

VERSION

This document describes version 0.04 of relpath (from Perl distribution App-relpath), released on 2015-01-03.

SYNOPSIS

Usage:

 % relpath [OPTIONS] <filename> ...

Examples:

 % relpath /etc/passwd /home/titin/f1 subdir/f2
 ../../etc/passwd
 f1
 subdir/f2

DESCRIPTION

This program complements the Unix command realpath. realpath converts relative pathnames to absolute ones, while relpath does the opposite.

The actual routine used is File::Spec's abs2rel() function.

By default, will check first that the filenames exist, unless --nocheck (-C) is specified.

OPTIONS

  • --[no]check, -c

    Whether to check that file exists. Default is on.

  • -C

    Alias for --nocheck.

EXIT CODES

0 on success.

1 on some error, e.g. some filenames are not found (and --check is on).

99 on command-line options error.

FAQ

SEE ALSO

realpath

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/App-relpath.

SOURCE

Source repository is at https://github.com/sharyanto/perl-App-relpath.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=App-relpath

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by perlancar@cpan.org.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.