How to get "cd dir" working as "cd dir ; pwd"?

How to get "cd dir" working as "cd dir ; pwd"?

Post by J. Zho » Sat, 12 Jun 1999 04:00:00



Dear Friends,

I use the sgi csh. I was wondering how to alias command "cd" which
can be performed as typing "cd dir ; pwd". The good thing is that
I will immidiately know which direction I am after I type command
"cd dir" without typing "pwd" again.

Thanks in advance.

Jack

 
 
 

How to get "cd dir" working as "cd dir ; pwd"?

Post by Barry Margoli » Sat, 12 Jun 1999 04:00:00




>I use the sgi csh. I was wondering how to alias command "cd" which
>can be performed as typing "cd dir ; pwd". The good thing is that
>I will immidiately know which direction I am after I type command
>"cd dir" without typing "pwd" again.

alias cd 'cd \!:1; pwd'

--

GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

How to get "cd dir" working as "cd dir ; pwd"?

Post by bmar.. » Sat, 12 Jun 1999 04:00:00



   >Dear Friends,
   >I use the sgi csh. I was wondering how to alias command "cd" which
   >can be performed as typing "cd dir ; pwd". The good thing is that
   >I will immidiately know which direction I am after I type command
   >"cd dir" without typing "pwd" again.
   >Thanks in advance.
   >Jack
Switch to tcsh or ksh or some other modern shell that lets you put the
current directory in your prompt.

Net-Tamer V 1.08X - Test Drive

 
 
 

How to get "cd dir" working as "cd dir ; pwd"?

Post by J. Zho » Tue, 15 Jun 1999 04:00:00





> >I use the sgi csh. I was wondering how to alias command "cd" which
> >can be performed as typing "cd dir ; pwd". The good thing is that
> >I will immidiately know which direction I am after I type command
> >"cd dir" without typing "pwd" again.

> alias cd 'cd \!:1; pwd'

> --

> GTE Internetworking, Powered by BBN, Burlington, MA
> *** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
> Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

Dear Barry,

Thank you very much. It almost solves the problem. One question left
is that I will get an error "Bad ! arg selector" if I just type "cd"
once alias cd 'cd \!:1; pwd'. As you know, command "cd" only will
change to my home direction by default. I was just wondering how to
retain this in the alias.

Thank you very much indeed again.

Jack

 
 
 

How to get "cd dir" working as "cd dir ; pwd"?

Post by J. Zho » Tue, 15 Jun 1999 04:00:00




>    >Dear Friends,
>    >I use the sgi csh. I was wondering how to alias command "cd" which
>    >can be performed as typing "cd dir ; pwd". The good thing is that
>    >I will immidiately know which direction I am after I type command
>    >"cd dir" without typing "pwd" again.
>    >Thanks in advance.
>    >Jack
> Switch to tcsh or ksh or some other modern shell that lets you put the
> current directory in your prompt.

> Net-Tamer V 1.08X - Test Drive

Dear Sir/Madam,

Thank you for your good suggestions. At the moment there is no tcsh
or ksh on my system. As a common user, I can suggust that
the system administrer set up them. But not sure. So could you
tell me details how to do it with tcsh or ksh

Many thanks again.

Jack

 
 
 

How to get "cd dir" working as "cd dir ; pwd"?

Post by Barry Margoli » Tue, 15 Jun 1999 04:00:00




>Thank you very much. It almost solves the problem. One question left
>is that I will get an error "Bad ! arg selector" if I just type "cd"
>once alias cd 'cd \!:1; pwd'. As you know, command "cd" only will
>change to my home direction by default. I was just wondering how to
>retain this in the alias.

Sounds like an issue with the SGI csh, as it worked fine for me in Solaris
2.6.

--

GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

How to get "cd dir" working as "cd dir ; pwd"?

Post by Tareixa Romero Quintán » Wed, 16 Jun 1999 04:00:00


alias cd 'cd \!*;pwd' works fine. Also you can set the prompt variable with
alias cd 'cd \!*;set prompt="`pwd`% "'

  -- Tareixa Romero

"Dr. J.G. Zhou" escribi:




> > >I use the sgi csh. I was wondering how to alias command "cd" which
> > >can be performed as typing "cd dir ; pwd". The good thing is that
> > >I will immidiately know which direction I am after I type command
> > >"cd dir" without typing "pwd" again.

> > alias cd 'cd \!:1; pwd'

> > --

> > GTE Internetworking, Powered by BBN, Burlington, MA
> > *** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
> > Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

> Dear Barry,

> Thank you very much. It almost solves the problem. One question left
> is that I will get an error "Bad ! arg selector" if I just type "cd"
> once alias cd 'cd \!:1; pwd'. As you know, command "cd" only will
> change to my home direction by default. I was just wondering how to
> retain this in the alias.

> Thank you very much indeed again.

> Jack

  tromero.vcf
< 1K Download
 
 
 

How to get "cd dir" working as "cd dir ; pwd"?

Post by J. Zho » Thu, 17 Jun 1999 04:00:00



> alias cd 'cd \!*;pwd' works fine. Also you can set the prompt variable with
> alias cd 'cd \!*;set prompt="`pwd`% "'

>   -- Tareixa Romero

Dear Tareixa,

Excellent. Thanks very much. Both works fine.

Regards.

Jack