bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ca - New bash command proposal


From: Andreas Schwab
Subject: Re: ca - New bash command proposal
Date: Thu, 12 Feb 2009 10:58:09 +0100
User-agent: Gnus/5.110009 (No Gnus v0.9) Emacs/22.3 (gnu/linux)

Mike Frysinger <vapier@gentoo.org> writes:

> On Wednesday 11 February 2009 23:38:10 Rolf Brudeseth wrote:
>> I would like to propose a new command for bash:
>>
>> ca [path]
>>
>> It returns the canonical path based on the current working directory and
>> entered path.
>>
>>
>> If the current working directory has been traversed through a symbolic
>> link, then listing a higher level path using dotdot's do not always show
>> I am looking for. Below is a trivial example:
>
> what's wrong with:
> ca() { cd "$(readlink -f -- "$@")"; }

ca() { (cd "$@" && pwd -P); }

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]