From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8389 invoked by alias); 28 Oct 2010 12:20:15 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 15518 Received: (qmail 12381 invoked from network); 28 Oct 2010 12:20:13 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, T_TO_NO_BRKTS_FREEMAIL autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 74.125.82.43 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=8wnTZDjN2GqgCH9TQ/y4l2rCxyBGYiJAGlTfbt4Z2Yg=; b=bYNEXGyKy5gsajRuSEjrVFMXfm3WXpHjFFxdA1e0qAhnzZyGKGwitFgNvSNvBG+fig WE3eCFvimKiIDcUS7AVEFKonP8R43w9iwVHElMYwPtt61PI8ClJkZOgSv7nkHbAtWYvo NPdBia1WCEN59W6Ewm1b8C6eZ6LxMDBneLJfg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=KXDswTKZx/BJPmzKqqFOzfmCsan+0uEdGbdyQbc7a/wOZkbwR1RqyBlM77oHCmyEv2 byYPCM55LPJKwrdIkmX2UZGn1YWJLGDIVPlAYx1gWRvFcUTG9eYay6zVIPq55taoiD9W Ro5IBulNQXL4QB9c14WFmkXcxc27esBNStxiE= MIME-Version: 1.0 In-Reply-To: <20101028104451.GB19471@prunille.vinc17.org> References: <20101027164454.GA19471@prunille.vinc17.org> <20101028104451.GB19471@prunille.vinc17.org> From: =?UTF-8?B?SsOpcsOpbWllIFJvcXVldA==?= Date: Thu, 28 Oct 2010 14:19:54 +0200 Message-ID: Subject: Re: Absolute path of a path To: zsh-users@zsh.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2010/10/28 Vincent Lefevre : > On 2010-10-27 18:54:17 +0200, J=C3=A9r=C3=A9mie Roquet wrote: >> 2010/10/27 Vincent Lefevre : >> > BTW, is there a way to get the canonicalised absolute pathname >> > with zsh? (i.e. what the "realpath" command gives.) >> >> your_path(:A) I guess :) > > No. The zsh man path says: > > =C2=A0A =C2=A0 =C2=A0As =C2=A0`a', =C2=A0but also resolve use of symbolic= links where possible. > =C2=A0 =C2=A0 =C2=A0 Note that resolution of `..' occurs before =C2=A0res= olution =C2=A0of =C2=A0sym=E2=80=90 > =C2=A0 =C2=A0 =C2=A0 bolic =C2=A0links. =C2=A0 This =C2=A0call is equival= ent to a unless your system > =C2=A0 =C2=A0 =C2=A0 has the realpath system call (modern systems do). > > but Linux doesn't have a realpath system call. > > ypig:~> man 2 realpath > No manual entry for realpath in section 2 > > FYI: > > ypig:~> realpath symlink/../vlefevre/symlink > /home/vlefevre > > ypig:~> echo symlink/../vlefevre/symlink(:A) > /home/vlefevre/vlefevre/symlink > > where symlink is a symbolic link to ".". Strange, it works for me. $ pwd /udir/jroquet $ ls -l .screenrc lrwxrwxrwx 1 jroquet kmem 37 2009-10-16 14:56 .screenrc -> /udir/jroquet/Arkonf/screen/.screenrc $ ls -l .screenrc(:A) -rw-r--r-- 1 jroquet kmem 1521 2010-02-24 18:44 /udir/jroquet/Arkonf/screen/.screenrc $ echo .screenrc(:A) /udir/jroquet/Arkonf/screen/.screenrc I'm running Ubuntu Linux 10.04, zsh 4.3.10 --=20 J=C3=A9r=C3=A9mie