HP 3000 Manuals

CHDIR [ MPE/iX Commands Reference Manual Volume I ] MPE/iX 5.0 Documentation


MPE/iX Commands Reference Manual Volume I

CHDIR 

Changes the process' current working directory (CWD). (Native Mode)

Syntax 

CHDIR [[DIR=]dir_name] [;SHOW | NOSHOW]

Parameters 

dir_name              The name of the directory you want to change to.
                      The dir_name is assumed to be an MPE name.  To
                      change to an HFS-named directory, begin dir_name 
                      with a dot (.)  or a slash (/).  The dir_name may
                      not end in a slash, and using wildcards is not
                      allowed.

                      This parameter is optional.  If you omit dir_name,
                      CHDIR switches you to your logon directory,
                      which is your logon group in the form:
                      /LOGON_ACCOUNT/LOGON_GROUP in all uppercase
                      letters.

SHOW                  Displays to $STDLIST the absolute pathname of the
                      new directory.  SHOW is the default.

NOSHOW                Does not display the absolute pathname.

Operation 

The CHDIR command changes your' CWD to dir_name or to your logon
directory (if you omit dir_name).

The CWD can be changed to any HFS directory, MPE account, or MPE group
where you have the appropriate permission.

The CWD is a process-local attribute.  When CHDIR is executed from the
CI, the CI's CWD is changed for the life of that CI process (or
until another CHDIR command is issued).  When CHDIR is executed
programmatically from a child process of the CI (for example, HPEDIT),
only that process' CWD is changed.  In this case, the parent process'
(for example, CI's) CWD is not affected.

The CHDIR and CHGROUP commands change their process' CWD; however, CHDIR
does not post any accounting information, and CHGROUP affects the CWD of
every process in the job/session structure.  Connect and CPU times are
still accounted to the user's logon account and logon group.

A new, read-only, predefined CI variable, HPCWD, contains the name of the
current working directory in HFS syntax.  At logon, HPCWD contains
"/ACCOUNT_NAME/LOGON_GROUP_NAME".  The HPCWD string value cannot exceed
255 characters.  If the CWD is too long, or has been removed (for
example, with the .2 shell rmdir command), then HPCWD will not be
accessible.

The CHGROUP command causes the HPCWD variable to be set to
"/ACCOUNT/GROUP_CHANGED_TO".

The table on the next page summarizes the differences and similarities
between the CHDIR and CHGROUP commands.

------------------------------------------------------------------------------------------
|                                                                                        |
|           Affects                      CHGROUP                       CHDIR             |
|                                                                                        |
------------------------------------------------------------------------------------------
|                                                                                        |
| Accumulation of CPU and                  yes                           no              |
| Connect times                                                                          |
|                                                                                        |
| Set of accessible files                  yes                           no              |
|                                                                                        |
| CWD of process                           yes                          yes              |
|                                                                                        |
| HPCWD variable                           yes                          yes              |
|                                                                                        |

| Disk space accumulation                  yes                           no              |
|                                                                                        |
------------------------------------------------------------------------------------------

Use 

The CHDIR command may be invoked from a job, a session, a program, or in
Break.  Pressing Break has no effect on this command.  You must have
traverse directory entries (TD) permission to each directory component in
dir_name (refer to the ALTSEC command in this chapter for more
information on directory permissions.)  The CWD is not changed if the
CHDIR command fails.

Examples 

The following example shows the command entry to change to the directory
dir1 in the MYGRP group in the MYACCT account.

     CHDIR /MYACCT/MYGRP/dir1 

The following example shows the command entry to change to the MPE group
level (AGROUP) in the MYACCT account.

     CHDIR /MYACCT/AGROUP 

The following example shows the command entry to change to a directory
named My_dir.  In this example, My_dir is a relative pathname and it is
subdirectory in the current working directory (CWD).

     CHDIR ./My_dir 

The following example shows the command entry to change to a directory
named john, in the group JONES, in the account MYACCT, by specifying the
full pathname.

     CHDIR /MYACCT/JONES/john 

In the following example, a change is made to a directory named final by
specifying the relative pathname.  The variable HPCWD displays the
current working directory after the change is made.

     CHDIR ./es/final 
     SHOWVAR HPCWD 

     HPCWD = /MYACCT/JONES/john/es/final

Related Information 

Commands      CHGROUP, FINDDIR (UDC), LISTFILE, LISTDIR (UDC), NEWDIR,
              PURGEDIR

Manuals       Performing System Management Tasks (32650-90004)



MPE/iX 5.0 Documentation