Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: checking link files - recursive search
- X-seq: zsh-users 11689
- From: pol <linux_milano@xxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: checking link files - recursive search
- Date: Mon, 30 Jul 2007 01:14:57 +0200
- Mail-copies-to: linux_milano@xxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <f8gnpp$b2f$1@xxxxxxxxxxxxx> <17393e3e0707281851g6e6e6f30y451fc31a031cfbaa@xxxxxxxxxxxxxx> <f8hok7$kol$1@xxxxxxxxxxxxx> <17393e3e0707291413w3391bc7jc191cfd64abced8b@xxxxxxxxxxxxxx>
- Reply-to: linux_milano@xxxxxxxx
- Sender: news <news@xxxxxxxxxxxxx>
<posted & mailed>
Matt Wozniski wrote:
> function resolve_recursive {
thank you for your hints
All in all, readlink is better.
Here included my script to open files (lyx files in my case) in their actual
directory.
--
Pol
--- enc.
#!/bin/zsh
open="/usr/bin/lyx"
inp=$1
if [ ! -h $1 ];then
if [ -f $1 ];then # it is a regular file
$open $inp
elif [ -d $1 ];then
echo $inp " is a directory"
else
echo $inp "not a regular file"
fi
elif [ -h $inp ]; then # it is a symbolic link
file=$(readlink -f "$inp")
fpath=$file:h
fname=$file:t
(cd $fpath && $open $fname)
fi
------
Messages sorted by:
Reverse Date,
Date,
Thread,
Author