pwd not found under csh or tcsh

pwd not found under csh or tcsh

Post by Alan Peters » Wed, 28 Jul 1993 03:00:57



I don't seem to have a /bin/pwd under csh or tcsh 6.04. I didn't find
it anywhere in the SLS test distribution or mentioned anywhere in the
FAQs. I looked around at sunsite and tsx-11 and didn't see where it
might be. Where would I find this binary or source.

Regads,
Alan Peterson

 
 
 

pwd not found under csh or tcsh

Post by Patrick J. Volkerdi » Wed, 28 Jul 1993 14:30:34



>I don't seem to have a /bin/pwd under csh or tcsh 6.04. I didn't find
>it anywhere in the SLS test distribution or mentioned anywhere in the
>FAQs. I looked around at sunsite and tsx-11 and didn't see where it
>might be. Where would I find this binary or source.

>Regads,
>Alan Peterson


Here's my /etc/csh.cshrc, which contains an alias to fix this problem.
It also sets up your paths for X and some other handy things.

if ($?prompt) then
        umask 022
        set cdpath = ( /sys /usr/spool )
        set notify
        set history = 100
        setenv OPENWINHOME /usr/openwin
        set path = ( /etc/local /etc /local/bin /usr/bin /bin /usr/etc
/usr/local/bin /usr/bin/X11 $OPENWINHOME/bin . )
endif
set prompt = "%m:%~%# "
set term = vt100
alias pwd 'echo $cwd'
alias ls 'ls -F'
alias net 'term < /dev/modem > /dev/modem 2> /dev/null &'
alias rz 'rz < /dev/modem > /dev/modem'
# You might want to remove the line below if you're configuring X.
alias startx 'startx >& /dev/null'

The path is really one line, but I thought you'd like to be able to read
it :^)

Hope this helps,

--
Patrick Volkerding



 
 
 

pwd not found under csh or tcsh

Post by Evmorfopoulos Dimitr » Thu, 29 Jul 1993 01:54:42



> I don't seem to have a /bin/pwd under csh or tcsh 6.04. I didn't find
> it anywhere in the SLS test distribution or mentioned anywhere in the
> FAQs. I looked around at sunsite and tsx-11 and didn't see where it
> might be. Where would I find this binary or source.

> Regads,
> Alan Peterson


        Since you want the source of pwd, here you go :

                        echo $PWD

        Put this in a file called pwd, do a chmod a+rx pwd, and you are all set.

                                                        Dimitris

 
 
 

pwd not found under csh or tcsh

Post by Daniel Quinl » Thu, 29 Jul 1993 00:17:09




>>I don't seem to have a /bin/pwd under csh or tcsh 6.04. I didn't find
>>it anywhere in the SLS test distribution or mentioned anywhere in the
>>FAQs. I looked around at sunsite and tsx-11 and didn't see where it
>>might be. Where would I find this binary or source.

>>Regads,
>>Alan Peterson

> [deleted...]
> alias pwd 'echo $cwd'
> [deleted...]

A faster (If those microseconds get to you) command to use in csh (or
tcsh) is:

alias pwd 'dirs -l'

Just for your info...

Dan
--
[ Daniel Quinlan                    |   Computer Science Engineer `95 ]

 
 
 

pwd not found under csh or tcsh

Post by Amos Shapi » Wed, 28 Jul 1993 20:46:10


   I don't seem to have a /bin/pwd under csh or tcsh 6.04. I didn't find
   it anywhere in the SLS test distribution or mentioned anywhere in the
   FAQs. I looked around at sunsite and tsx-11 and didn't see where it
   might be. Where would I find this binary or source.

I also didn't find it anywere.  Looks like bash handles this because it's
a builtin.  But that's not enough for shell scripts so I put something like
this in /bin/pwd:
----------------------------------------------------------------------
#!/bin/sh
pwd
----------------------------------------------------------------------

And got done with it.  A bit of an overkill I admit but not much.  Another
option might be to just write a small C programme which calls the libc getwd(3)
and prints the result, a-la (untested):
----------------------------------------------------------------------
#include <stdio.h>
#include <sys/params.h>           /* dunno what's the equivalent on Linux, alas
                                 * our Linux machine is down to Loss right now
                                 */
main ()
{
        extern char *getwd (char *);
        char buf[MAXPATHLEN+2];

        puts (getwd (buf));

        exit (0);

Quote:}

----------------------------------------------------------------------

Or something to that effect.

Cheers,

--Amos
--
--Amos Shapira (Jumper Extraordinaire) |  "It is true that power corrupts,
C.S. System Group, Hebrew University,  |   but absolute power is better!"
Jerusalem 91904, ISRAEL                |

 
 
 

pwd not found under csh or tcsh

Post by Nick Hillia » Wed, 28 Jul 1993 20:09:55


: I don't seem to have a /bin/pwd under csh or tcsh 6.04. I didn't find
: it anywhere in the SLS test distribution or mentioned anywhere in the
: FAQs. I looked around at sunsite and tsx-11 and didn't see where it
: might be. Where would I find this binary or source.

Hmmm - should be in the FAQs.  Try:

alias pwd echo \$cwd

Nick
--

| Quay Financial Software,       | Phone:    [+353] 1 6612377               |
| Ferry House, Lower Mount St,   | Fax:      [+353] 1 6607592               |
| Dublin 2, Ireland.             | Opinions: I think; therefore I disclaim. |