HPlogo Commands Reference HP 3000 Series 9X8LX Computer Systems > Chapter 2 MPE/iX Commands

CHDIR

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

This command changes the process' current working directory (CWD).

Syntax

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

Parameters

dir_name

The name of the new current directory (optional). The dir_name is assumed to be an MPE name. You can change to HFS-named directories if dir_name starts with a dot (.) or a slash (/). The dir_name may not end in a slash, and using wildcards is not allowed. If dir_name is omitted, your logon directory is used. Your logon directory is your logon group, in the form: /LOGON_ACCOUNT/LOGON_GROUP.

SHOW

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

NOSHOW

Does not display the absolute pathname.

Operation Notes

You can use the CHDIR command to change the process' CWD to dir_name. If dir_name is omitted, the logon group is assumed. The user always has a logon group.

The CHDIR command changes the CWD to an MPE-named directory. This means that dir_name must follow all MPE naming rules, unless it is prefixed with a dot (.) or a slash (/).

You can change the CWD 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 time 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 below summarizes the differences and similarities between the CHDIR and CHGROUP commands.

AffectsCHGROUPCHDIR
Accumulation of CPU and Connect timeyesno
Set of accessible filesyesno
CWD of processyesyes
HPCWD variableyesyes
Disk space accumulationyesyes

Use

You can issue the CHDIR command from a job, a session, a program, or in break mode. 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.) If the CHDIR command fails, the CWD does not change..

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, that is, relative to 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

The following example shows that 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 Commands

   CHGROUP

   FINDDIR (UDC)

   LISTDIR (UDC)

   NEWDIR

   PURGEDIR
Feedback to webmaster