Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ksh:/usr/bin/cd <> cd !!!!

Status
Not open for further replies.

lepap

Technical User
Feb 11, 2002
4
FR
A big problem for a little bug ?

In an automation process, I had to run a script without any PATH variable.
So I had to code, on my aix 4.3, /usr/bin/ls, /usr/bin/echo and so on.
(I know, i could have added /usr/bin to my PATH).
but this is not the main problem : i coded also /usr/bin/cd, as a newbie I am.
and then, what a surprise : the /usr/bin/cd command doesn't do anything and does not return any error.
What is happening to me ?
Help...
 
"cd" is a "shell built-in" command...

/home/OPERATOR/log> whence ls
/usr/bin/ls
/home/OPERATOR/log> whence cd
cd
/home/OPERATOR/log>

If anything, you would need to put a "." in front of the /usr/bin/cd because if you think about, calling /usr/bin/cd would call a new shell. Since you can't pass the new directory UP a shell, you are returned to the same directory.

Bill.
 
Is exactly that. The cd command must be a built in.
I hope it works...
Unix was made by and for smart people.
 
Thanks for all
It was my first guess on the forum - and it's a success

I'll "whence" all the time (internal command ?)

p@p
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top