Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Dereferencing a symlink...or that alike...
- X-seq: zsh-users 17939
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Dereferencing a symlink...or that alike...
- Date: Sat, 17 Aug 2013 22:05:59 -0700
- In-reply-to: <20130818024002.GC3129@solfire>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20130818024002.GC3129@solfire>
On Aug 18, 4:40am, meino.cramer@xxxxxx wrote:
}
} suppose I have the following symlink in my $HOME
}
} etcetera -> /etc
}
} . Is there a way to get back "/etc" only (not the contents
} of /etc/. nor "etcetera") when doing a 'ls' or such?
Depends on what is covered by "or such" ...
% zmodload zsh/stat
% zstat +link etcetera
/etc
However, that prints nothing if the file is not a symbolic link.
I don't know of any external utility that will print *only* the target
of the symlink. E.g.
% /usr/bin/stat --format=%N etcetera
'etcetera' -> '/etc'
Messages sorted by:
Reverse Date,
Date,
Thread,
Author