[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference vaxaxp::vmsnotes

Title:VAX and Alpha VMS
Notice:This is a new VMSnotes, please read note 2.1
Moderator:VAXAXP::BERNARDO
Created:Thu Jan 23 1997
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:703
Total number of notes:3722

565.0. "Symbol substitution in PIPE command" by KAOFS::R_DAVEY (Robin Davey CSC/CTH dtn 772-7220) Mon May 05 1997 19:51

    I have just had a customer report a problem with the OpenVMS V7.1
    PIPE command.  He reported that he could use symbol substitution
    in a pipe command but I found with testing that the symbol couldn't
    be used if it was defined in the same PIPE command.  If the symbol
    is defined before the PIPE command is executed it can be used.
    
    A symbol defined in a PIPE command can be SHOWed in the same PIPE
    command it is defined in.
    
    Should this be QAR'd?  I've attached output from my testing.
    
    
    Robin Davey
    OpenVMS Support
    CSC/CTH
    
    CTHU62> x:==login.com                   ! define a symbol
    
    CTHU62> pipe show symb x ; dir 'x       ! use symbol in pipe command
    
      X == "LOGIN.COM"                      ! can show symbol
    
    Directory SYS$SYSDEVICE:[TEST]
    
    LOGIN.COM;1                                    1   5-MAY-1997 15:05:09.51
    
    Total of 1 file, 1 block.               ! can use symbol
    
    
    CTHU62> del/sym/glo x                   ! delete the symbol
    
    
                                            ! define symbol in the pipe command
    
    CTHU62> pipe x:==login.com ; show symb x ; dir 'x   
    
      X == "LOGIN.COM"                      ! can still show symbol
    
    Directory SYS$SYSDEVICE:[TEST]
    
    LOGIN.COM;1                                    1   5-MAY-1997 15:05:09.51
    TEST.TXT;1                                     1   5-MAY-1997 15:05:41.14
    
    Total of 2 files, 2 blocks.             ! symbol appears to be ignored 
                                                 totally
    
    
                                            ! hit up-arrow & redo pipe command
    
    CTHU62> pipe x:==login.com ; show symb x ; dir 'x
    
      X == "LOGIN.COM"                      ! show symbol always works
    
    Directory SYS$SYSDEVICE:[TEST]
    
    LOGIN.COM;1                                    1   5-MAY-1997 15:05:09.51
    
    Total of 1 file, 1 block.               ! using symbol now works but I 
                                               assume it's because it was
                                               predefined by the previous 
                                               pipe command
T.RTitleUserPersonal
Name
DateLines
565.1Answered my own question...KAOFS::R_DAVEYRobin Davey CSC/CTH dtn 772-7220Mon May 05 1997 20:097
    I think I just answered my own question.
    
    The CLI does all symbol substitution in the command line before 
    any execution is performed.   Is this correct?
    
    
    Robin
565.2Symbol Substitution Occurs Early...XDELTA::HOFFMANSteve, OpenVMS EngineeringMon May 05 1997 20:465
:    The CLI does all symbol substitution in the command line before 
:    any execution is performed.   Is this correct?

   Yes, this is correct.

565.3Another possibility along the same linesGIDDAY::GILLINGSa crucible of informative mistakesTue May 06 1997 03:1243
  Also be aware that some PIPE commands will generate subprocesses, it is
  therefore possible to invent command sequences where it's impossible for
  symbol definitions to propogate. The subprocesses work in parallel so you
  have to stop thinking linearly. For example

$ PIPE 	SHOW TIME | -			   ! Executed in MAIN process
	x=="SWAPPER" ; show system | -	   ! Executed in subprocess 1
	SEARCH SYS$INPUT 'X' ; SHOW SYM X  ! Executed in subprocess 2
%DCL-W-INSFPRM, missing command parameters - supply all required parameters
%DCL-W-UNDSYM, undefined symbol - check validity and spelling

$ show sym x	! back in main process
%DCL-W-UNDSYM, undefined symbol - check validity and spelling

  The global symbol X only exists in subprocess 1. Since both subprocesses
  are spawned from the parent (see AUDIT messages below), there is no way
  for subprocess 2 to "see" any symbols defined in subprocess 1.

%%%%%%%%%%%  OPCOM   6-MAY-1997 13:03:05.22  %%%%%%%%%%%
Message from user AUDIT$SERVER on FLANGE
Security alarm (SECURITY) on FLANGE, system id: 60860
Auditable event:          Subprocess or pipe subprocess login
Event time:                6-MAY-1997 13:03:05.22
PID:                      0000033A        Parent PID:               00000140
Process name:             GILLINGS_1      Parent process name:      GILLINGS
Username:                 GILLINGS        Parent username:          GILLINGS
Process owner:            [TSC,GILLINGS]
Image name:               $7$DKA100:[SYS0.SYSCOMMON.][SYSEXE]LOGINOUT.EXE

%%%%%%%%%%%  OPCOM   6-MAY-1997 13:03:05.33  %%%%%%%%%%%
Message from user AUDIT$SERVER on FLANGE
Security alarm (SECURITY) on FLANGE, system id: 60860
Auditable event:          Subprocess or pipe subprocess login
Event time:                6-MAY-1997 13:03:05.32
PID:                      0000033B        Parent PID:               00000140
Process name:             GILLINGS_2      Parent process name:      GILLINGS
Username:                 GILLINGS        Parent username:          GILLINGS
Process owner:            [TSC,GILLINGS]
Image name:               $7$DKA100:[SYS0.SYSCOMMON.][SYSEXE]LOGINOUT.EXE

  (there are actually another 2 subprocesses spawned as well, I'm not sure
  why).
						John Gillings, Sydney CSC