PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.unix.shell > retaining "link path" with pwd
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.unix.shell Using and programming the Unix shell.

retaining "link path" with pwd

Réponse
 
LinkBack Outils de la discussion
Vieux 10/03/2007, 09h16   #1
Mahurshi Akilla
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut retaining "link path" with pwd

Is there a way to retain the "link path" when I do pwd or cwd ?

for e.g.

lets say, I do the following:

cd /link1/link2/link3/folder4/
pwd

I want to get back "/link1/link2/link3/folder4/"
instead of /nfs/blah/blah/blah/blah/folder4/

Can this be done ?

Mahurshi Akilla

  Réponse avec citation
Vieux 10/03/2007, 09h27   #2
jimmij
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: retaining "link path" with pwd

"Mahurshi Akilla" <mahurshi@gmail.com> writes:

> Is there a way to retain the "link path" when I do pwd or cwd ?
>
> for e.g.
>
> lets say, I do the following:
>
> cd /link1/link2/link3/folder4/
> pwd
>
> I want to get back "/link1/link2/link3/folder4/"
> instead of /nfs/blah/blah/blah/blah/folder4/


It depends which shell do you use. Try
pwd -P

--
jimmij
  Réponse avec citation
Vieux 10/03/2007, 09h35   #3
jimmij
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: retaining "link path" with pwd

jimmij <jimmij@jj.jj> writes:

>> Is there a way to retain the "link path" when I do pwd or cwd ?
>>
>> for e.g.
>>
>> lets say, I do the following:
>>
>> cd /link1/link2/link3/folder4/
>> pwd
>>
>> I want to get back "/link1/link2/link3/folder4/"
>> instead of /nfs/blah/blah/blah/blah/folder4/

>
> It depends which shell do you use. Try
> pwd -P


Ehh... In this case rather "pwd -L"

--
jimmij
  Réponse avec citation
Vieux 10/03/2007, 10h58   #4
Mahurshi Akilla
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: retaining "link path" with pwd

On Mar 10, 12:35 am, jimmij <jim...@jj.jj> wrote:
> jimmij <jim...@jj.jj> writes:
> >> Is there a way to retain the "link path" when I do pwd or cwd ?

>
> >> for e.g.

>
> >> lets say, I do the following:

>
> >> cd /link1/link2/link3/folder4/
> >> pwd

>
> >> I want to get back "/link1/link2/link3/folder4/"
> >> instead of /nfs/blah/blah/blah/blah/folder4/

>
> > It depends which shell do you use. Try
> > pwd -P

>
> Ehh... In this case rather "pwd -L"
>
> --
> jimmij



Hmm.. none of these options worked. I am using csh. What shell are
you guys using?


Mahurshi Akilla

  Réponse avec citation
Vieux 10/03/2007, 11h21   #5
jimmij
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: retaining "link path" with pwd

"Mahurshi Akilla" <mahurshi@gmail.com> writes:

>> > It depends which shell do you use. Try
>> > pwd -P

>>
>> Ehh... In this case rather "pwd -L"

>
> Hmm.. none of these options worked. I am using csh. What shell are
> you guys using?


Bash.
In (t)csh you can use e.g. "echo $PWD".

--
jimmij
  Réponse avec citation
Vieux 10/03/2007, 11h22   #6
jimmij
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: retaining "link path" with pwd

"Mahurshi Akilla" <mahurshi@gmail.com> writes:

>> > It depends which shell do you use. Try
>> > pwd -P

>>
>> Ehh... In this case rather "pwd -L"

>
> Hmm.. none of these options worked. I am using csh. What shell are
> you guys using?


Bash.
In (t)csh you can use e.g. "echo $PWD".

--
jimmij
  Réponse avec citation
Vieux 10/03/2007, 13h52   #7
Bruce Barnett
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: retaining "link path" with pwd

jimmij <jimmij@jj.jj> writes:

> "Mahurshi Akilla" <mahurshi@gmail.com> writes:
>
>>> > It depends which shell do you use. Try
>>> > pwd -P
>>>
>>> Ehh... In this case rather "pwd -L"

>>
>> Hmm.. none of these options worked. I am using csh. What shell are
>> you guys using?

>
> Bash.
> In (t)csh you can use e.g. "echo $PWD".


Well, in csh there is a builtin variable $cwd

Check the manual page. As I recall, on Solaris there is a variable you
can set to get the function you want.


Look at the "symlink" variable as well.


--
Sending unsolicited commercial e-mail to this account incurs a fee of
$500 per message, and acknowledges the legality of this contract.
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 22h56.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,11753 seconds with 15 queries