1997-11-18 05:31:00 +00:00
|
|
|
**************************************************************************
|
|
|
|
*
|
|
|
|
* The GNO Shell Project
|
|
|
|
*
|
|
|
|
* Developed by:
|
|
|
|
* Jawaid Bazyar
|
|
|
|
* Tim Meekins
|
|
|
|
* Derek Taubert
|
|
|
|
*
|
1998-12-21 23:57:08 +00:00
|
|
|
* $Id: shellvar.asm,v 1.7 1998/12/21 23:57:08 tribby Exp $
|
1998-04-24 15:38:47 +00:00
|
|
|
*
|
1997-11-18 05:31:00 +00:00
|
|
|
**************************************************************************
|
|
|
|
*
|
|
|
|
* SHELLVAR.ASM
|
|
|
|
* By Tim Meekins
|
Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
of expanded $HOME match the user's delimiter.
* When wildcard patterns don't match, rather than terminating the command
gsh now prints "No match: <pattern> ignored" and passes the command line
minus the unmatched patterns on to be executed.
* Modified echo command so it doesn't add a blank to the end.
* Make "clear" and "source" built-ins non-forked commands. Unforking
"source" allows prefixes to be set in files that are sourced.
* Add loop to parse a single command (removing leading whitespace) before
sending it off to be expanded and executed. Skip null lines and comments
at this level. This allows later commands that depend upon variables set
in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
Also fixes problems seen when tab was first character of multiple lines.
* Initialize environment variable flags at startup (for echo, nodirexec,
nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
flag when env var is set in upper or lower case (formerly, only worked
with lower case).
* Lots of places two-word addresses are incremented using inc, without
checking for overflow into the high-order word. As these are discovered,
they are changed to use adc on both words.
See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
|
|
|
* Modified by Dave Tribby for GNO 2.0.6
|
1997-11-18 05:31:00 +00:00
|
|
|
*
|
|
|
|
* Routines for handling variables in the shell
|
|
|
|
*
|
Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
of expanded $HOME match the user's delimiter.
* When wildcard patterns don't match, rather than terminating the command
gsh now prints "No match: <pattern> ignored" and passes the command line
minus the unmatched patterns on to be executed.
* Modified echo command so it doesn't add a blank to the end.
* Make "clear" and "source" built-ins non-forked commands. Unforking
"source" allows prefixes to be set in files that are sourced.
* Add loop to parse a single command (removing leading whitespace) before
sending it off to be expanded and executed. Skip null lines and comments
at this level. This allows later commands that depend upon variables set
in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
Also fixes problems seen when tab was first character of multiple lines.
* Initialize environment variable flags at startup (for echo, nodirexec,
nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
flag when env var is set in upper or lower case (formerly, only worked
with lower case).
* Lots of places two-word addresses are incremented using inc, without
checking for overflow into the high-order word. As these are discovered,
they are changed to use adc on both words.
See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
|
|
|
* Note: text set up for tabs at col 16, 22, 41, 49, 57, 65
|
|
|
|
* | | | | | |
|
|
|
|
* ^ ^ ^ ^ ^ ^
|
1998-12-21 23:57:08 +00:00
|
|
|
**************************************************************************
|
|
|
|
*
|
|
|
|
* Interfaces defined in this file:
|
|
|
|
*
|
|
|
|
* updatevars subroutine (4:var,2:flag),space ;flag 1: set, 0: unset
|
|
|
|
* InitVars jsr without any parameters
|
|
|
|
*
|
|
|
|
* Remainder are interfaces to builtin commands with interface
|
|
|
|
* subroutine (4:argv,2:argc)
|
|
|
|
* returns status in accumulator
|
|
|
|
* export
|
|
|
|
* set (setenv is alternate entry point)
|
|
|
|
* unset
|
|
|
|
*
|
1997-11-18 05:31:00 +00:00
|
|
|
**************************************************************************
|
|
|
|
|
1998-04-24 15:38:47 +00:00
|
|
|
mcopy /obj/gno/bin/gsh/shellvar.mac
|
|
|
|
|
Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
of expanded $HOME match the user's delimiter.
* When wildcard patterns don't match, rather than terminating the command
gsh now prints "No match: <pattern> ignored" and passes the command line
minus the unmatched patterns on to be executed.
* Modified echo command so it doesn't add a blank to the end.
* Make "clear" and "source" built-ins non-forked commands. Unforking
"source" allows prefixes to be set in files that are sourced.
* Add loop to parse a single command (removing leading whitespace) before
sending it off to be expanded and executed. Skip null lines and comments
at this level. This allows later commands that depend upon variables set
in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
Also fixes problems seen when tab was first character of multiple lines.
* Initialize environment variable flags at startup (for echo, nodirexec,
nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
flag when env var is set in upper or lower case (formerly, only worked
with lower case).
* Lots of places two-word addresses are incremented using inc, without
checking for overflow into the high-order word. As these are discovered,
they are changed to use adc on both words.
See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
|
|
|
dummyshellvar start ; ends up in .root
|
1998-04-24 15:38:47 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
setcom 60
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
**************************************************************************
|
|
|
|
*
|
1998-07-20 16:23:11 +00:00
|
|
|
* SET/SETENV: builtin command
|
1997-11-18 05:31:00 +00:00
|
|
|
* syntax: set - displays all variables
|
|
|
|
* set ... [var] - displays the value of var
|
|
|
|
* set [var=value]... - sets var to value
|
|
|
|
* set [var value]... - sets var to value
|
|
|
|
*
|
|
|
|
**************************************************************************
|
|
|
|
|
|
|
|
set START
|
|
|
|
|
|
|
|
arg equ 1
|
|
|
|
valbuf equ arg+4
|
|
|
|
varbuf equ valbuf+4
|
1998-07-20 16:23:11 +00:00
|
|
|
exflag equ varbuf+4
|
1998-12-21 23:57:08 +00:00
|
|
|
status equ exflag+2
|
|
|
|
space equ status+2
|
1997-11-18 05:31:00 +00:00
|
|
|
argc equ space+3
|
|
|
|
argv equ argc+2
|
|
|
|
end equ argv+4
|
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
;
|
|
|
|
; Entry point for set command: clear export flag after setting up params.
|
|
|
|
;
|
|
|
|
|
|
|
|
; subroutine (4:argv,2:argc),space
|
|
|
|
|
|
|
|
tsc
|
|
|
|
sec
|
|
|
|
sbc #space-1
|
|
|
|
tcs
|
|
|
|
phd
|
|
|
|
tcd
|
|
|
|
|
|
|
|
stz exflag
|
|
|
|
bra startcmd Go start the command.
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
; Entry point for setenv command: set export flag after setting up params.
|
|
|
|
;
|
|
|
|
setenv ENTRY
|
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
; subroutine (4:argv,2:argc),space
|
|
|
|
|
|
|
|
tsc
|
|
|
|
sec
|
|
|
|
sbc #space-1
|
|
|
|
tcs
|
|
|
|
phd
|
|
|
|
tcd
|
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
lda #1
|
|
|
|
sta exflag
|
|
|
|
|
|
|
|
;
|
|
|
|
; Beginning of main code for both set and setenv commands
|
|
|
|
;
|
|
|
|
startcmd anop
|
|
|
|
|
1998-12-21 23:57:08 +00:00
|
|
|
stz status
|
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
lda argc If no parameter provided,
|
1997-11-18 05:31:00 +00:00
|
|
|
dec a
|
1998-07-20 16:23:11 +00:00
|
|
|
beq showvars list all variables.
|
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
1998-07-20 16:23:11 +00:00
|
|
|
; If parameter provided, check for an illegal '-' starting the parm
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
|
|
|
ldy #4
|
|
|
|
lda [argv],y
|
|
|
|
sta arg
|
|
|
|
iny2
|
|
|
|
lda [argv],y
|
|
|
|
sta arg+2
|
|
|
|
lda [arg]
|
|
|
|
and #$FF
|
|
|
|
cmp #'-'
|
|
|
|
beq showusage
|
|
|
|
jmp skipvar
|
|
|
|
|
|
|
|
showusage ldx #^Usage
|
|
|
|
lda #Usage
|
|
|
|
jsr errputs
|
1998-12-21 23:57:08 +00:00
|
|
|
inc status Return status = 1.
|
1997-11-18 05:31:00 +00:00
|
|
|
jmp exit
|
1998-07-20 16:23:11 +00:00
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
1998-07-20 16:23:11 +00:00
|
|
|
; Show all environment variables
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
|
|
|
showvars anop
|
1998-08-03 17:30:30 +00:00
|
|
|
ph4 #261
|
|
|
|
~NEW Allocate 261 bytes
|
1998-07-20 16:23:11 +00:00
|
|
|
sta varbuf for name buffer.
|
1997-11-18 05:31:00 +00:00
|
|
|
stx varbuf+2
|
|
|
|
ora varbuf+2
|
|
|
|
beq svwhoops
|
1998-07-20 16:23:11 +00:00
|
|
|
jsl alloc1024 Allocate 1024 bytes
|
|
|
|
sta valbuf for result buffer.
|
1997-11-18 05:31:00 +00:00
|
|
|
stx valbuf+2
|
1998-07-20 16:23:11 +00:00
|
|
|
ora valbuf+2 If memory was not allocated,
|
1997-11-18 05:31:00 +00:00
|
|
|
bne startshow
|
1998-08-03 17:30:30 +00:00
|
|
|
ph4 varbuf
|
|
|
|
jsl nullfree
|
1998-07-20 16:23:11 +00:00
|
|
|
svwhoops ld2 $201,ErrError report memory error
|
Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
of expanded $HOME match the user's delimiter.
* When wildcard patterns don't match, rather than terminating the command
gsh now prints "No match: <pattern> ignored" and passes the command line
minus the unmatched patterns on to be executed.
* Modified echo command so it doesn't add a blank to the end.
* Make "clear" and "source" built-ins non-forked commands. Unforking
"source" allows prefixes to be set in files that are sourced.
* Add loop to parse a single command (removing leading whitespace) before
sending it off to be expanded and executed. Skip null lines and comments
at this level. This allows later commands that depend upon variables set
in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
Also fixes problems seen when tab was first character of multiple lines.
* Initialize environment variable flags at startup (for echo, nodirexec,
nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
flag when env var is set in upper or lower case (formerly, only worked
with lower case).
* Lots of places two-word addresses are incremented using inc, without
checking for overflow into the high-order word. As these are discovered,
they are changed to use adc on both words.
See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
|
|
|
ErrorGS Err
|
1998-12-21 23:57:08 +00:00
|
|
|
inc status set return status = 1
|
|
|
|
jmp exit and exit.
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
startshow anop
|
1998-07-20 16:23:11 +00:00
|
|
|
lda #1022 Store buffer len == 1022 in value
|
|
|
|
sta [valbuf] buffer (save 2 bytes at end for 0).
|
1998-08-03 17:30:30 +00:00
|
|
|
lda #260 Store buffer len == 260 in name
|
1998-07-20 16:23:11 +00:00
|
|
|
sta [varbuf] buffer.
|
Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
of expanded $HOME match the user's delimiter.
* When wildcard patterns don't match, rather than terminating the command
gsh now prints "No match: <pattern> ignored" and passes the command line
minus the unmatched patterns on to be executed.
* Modified echo command so it doesn't add a blank to the end.
* Make "clear" and "source" built-ins non-forked commands. Unforking
"source" allows prefixes to be set in files that are sourced.
* Add loop to parse a single command (removing leading whitespace) before
sending it off to be expanded and executed. Skip null lines and comments
at this level. This allows later commands that depend upon variables set
in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
Also fixes problems seen when tab was first character of multiple lines.
* Initialize environment variable flags at startup (for echo, nodirexec,
nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
flag when env var is set in upper or lower case (formerly, only worked
with lower case).
* Lots of places two-word addresses are incremented using inc, without
checking for overflow into the high-order word. As these are discovered,
they are changed to use adc on both words.
See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
|
|
|
lock setmutex
|
1998-07-20 16:23:11 +00:00
|
|
|
mv4 varbuf,idxName Initialize ReadIndexedGS
|
|
|
|
mv4 valbuf,idxValue parameter block.
|
|
|
|
ld2 1,idxIndex Start index at 1.
|
|
|
|
|
|
|
|
showloop ReadIndexedGS idxParm Get next indexed variable.
|
|
|
|
ldy #2 Get length of name.
|
1997-11-18 05:31:00 +00:00
|
|
|
lda [varbuf],y
|
1998-07-20 16:23:11 +00:00
|
|
|
beq showdone If 0, we've got all the names.
|
1998-08-03 17:30:30 +00:00
|
|
|
cmp #257 If len > 256,
|
1998-07-20 16:23:11 +00:00
|
|
|
bcs bumpindx we didn't get it.
|
|
|
|
|
1998-08-03 17:30:30 +00:00
|
|
|
tay Store 0 at end of
|
1998-09-08 16:53:14 +00:00
|
|
|
iny4 name string so it
|
1998-08-03 17:30:30 +00:00
|
|
|
short a can be treated like
|
|
|
|
lda #0 a c-string.
|
|
|
|
sta [varbuf],y
|
|
|
|
long a
|
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
ldx idxExport X = variable's export flag.
|
1998-08-03 17:30:30 +00:00
|
|
|
ldy #4 Y = offset in varname to text.
|
1998-07-20 16:23:11 +00:00
|
|
|
jsr prnameval Print varname and varval.
|
|
|
|
|
|
|
|
bumpindx inc idxIndex Bump index number.
|
|
|
|
bra showloop Handle the next env variable.
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
;
|
|
|
|
; Done showing the list of all variables.
|
|
|
|
;
|
|
|
|
showdone anop
|
|
|
|
unlock setmutex Unlock mutual exclusion.
|
1998-08-03 17:30:30 +00:00
|
|
|
ph4 varbuf
|
|
|
|
jsl nullfree Free the name buffer.
|
1997-11-18 05:31:00 +00:00
|
|
|
ldx valbuf+2
|
|
|
|
lda valbuf
|
1998-07-20 16:23:11 +00:00
|
|
|
jsl free1024 Free the value buffer.
|
|
|
|
jmp exit Exit.
|
|
|
|
|
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
1998-07-20 16:23:11 +00:00
|
|
|
; Set the value of a variable (loop begins here)
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
of expanded $HOME match the user's delimiter.
* When wildcard patterns don't match, rather than terminating the command
gsh now prints "No match: <pattern> ignored" and passes the command line
minus the unmatched patterns on to be executed.
* Modified echo command so it doesn't add a blank to the end.
* Make "clear" and "source" built-ins non-forked commands. Unforking
"source" allows prefixes to be set in files that are sourced.
* Add loop to parse a single command (removing leading whitespace) before
sending it off to be expanded and executed. Skip null lines and comments
at this level. This allows later commands that depend upon variables set
in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
Also fixes problems seen when tab was first character of multiple lines.
* Initialize environment variable flags at startup (for echo, nodirexec,
nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
flag when env var is set in upper or lower case (formerly, only worked
with lower case).
* Lots of places two-word addresses are incremented using inc, without
checking for overflow into the high-order word. As these are discovered,
they are changed to use adc on both words.
See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
|
|
|
setvar lock setmutex
|
1998-07-20 16:23:11 +00:00
|
|
|
lda argc If we've run out of parameters,
|
|
|
|
jeq doneset we are done setting values.
|
1997-11-18 05:31:00 +00:00
|
|
|
lda [argv]
|
|
|
|
sta arg
|
1998-07-20 16:23:11 +00:00
|
|
|
ldy #2
|
1997-11-18 05:31:00 +00:00
|
|
|
lda [argv],y
|
|
|
|
sta arg+2
|
1998-07-20 16:23:11 +00:00
|
|
|
;
|
|
|
|
; Examine characters in second argument to determine syntax style
|
|
|
|
;
|
1997-11-18 05:31:00 +00:00
|
|
|
ldy #0
|
|
|
|
chkeql lda [arg],y
|
|
|
|
and #$FF
|
1998-07-20 16:23:11 +00:00
|
|
|
beq orcastyle No "=": user ORCA-style parsing
|
|
|
|
cmp #'=' "=" found: use UNIX-style parsing
|
1997-11-18 05:31:00 +00:00
|
|
|
jeq unixstyle
|
|
|
|
iny
|
|
|
|
bra chkeql
|
1998-07-20 16:23:11 +00:00
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
1998-07-20 16:23:11 +00:00
|
|
|
; No "=" found in second argument. Either ORCA style or a single var show.
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
1998-07-20 16:23:11 +00:00
|
|
|
orcastyle add2 argv,#4,argv Point to next argument.
|
1997-11-18 05:31:00 +00:00
|
|
|
dec argc
|
1998-07-20 16:23:11 +00:00
|
|
|
jeq showonevar If only one arg, it's a single show.
|
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
ldy #2
|
|
|
|
lda [argv],y
|
|
|
|
pha
|
1998-09-08 16:53:14 +00:00
|
|
|
lda [argv] Create GS/OS string
|
1998-07-20 16:23:11 +00:00
|
|
|
pha that contains the value.
|
|
|
|
bra set1 Complete operation in UNIX-style code.
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
;
|
|
|
|
; UNIX style set. Uses two arguments separated by "=".
|
|
|
|
; When we get here, Y-reg = index of "=" character.
|
|
|
|
;
|
1998-09-08 16:53:14 +00:00
|
|
|
unixstyle cpy #0
|
1997-11-18 05:31:00 +00:00
|
|
|
bne unix0
|
|
|
|
ldx #^error1
|
1998-07-20 16:23:11 +00:00
|
|
|
lda #error1 Print error message:
|
|
|
|
jsr errputs 'Variable not specified'
|
1998-12-21 23:57:08 +00:00
|
|
|
inc status Return status = 1.
|
1998-07-20 16:23:11 +00:00
|
|
|
jmp doneset
|
|
|
|
unix0 short a Store '\0' on
|
|
|
|
lda #0 on top of '='
|
|
|
|
sta [arg],y so it looks
|
|
|
|
long a like a c-string.
|
|
|
|
tya Add length of variable name
|
|
|
|
sec to address of arg to get
|
|
|
|
adc arg address of value.
|
1997-11-18 05:31:00 +00:00
|
|
|
pei (arg+2)
|
|
|
|
pha
|
1998-07-20 16:23:11 +00:00
|
|
|
|
|
|
|
set1 jsr c2gsstr Convert value to GS/OS string.
|
|
|
|
sta RSvalue
|
|
|
|
stx RSvalue+2
|
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
pei (arg+2)
|
|
|
|
pei (arg)
|
1998-07-20 16:23:11 +00:00
|
|
|
jsr c2gsstr Convert name to GS/OS string.
|
|
|
|
sta RSname
|
|
|
|
stx RSname+2
|
|
|
|
|
|
|
|
lda exflag Set export flag in parameter block.
|
|
|
|
sta RSexport
|
1998-09-08 16:53:14 +00:00
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
SetGS ReadSetVar Set variable value & export flag.
|
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
pei (arg+2)
|
|
|
|
pei (arg)
|
1998-07-20 16:23:11 +00:00
|
|
|
pea 1
|
|
|
|
jsl updatevars Update special shell flags.
|
|
|
|
|
|
|
|
ph4 RSname
|
|
|
|
jsl nullfree Free name buffer.
|
|
|
|
ph4 RSvalue
|
|
|
|
jsl nullfree Free value buffer.
|
1997-11-18 05:31:00 +00:00
|
|
|
|
Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
of expanded $HOME match the user's delimiter.
* When wildcard patterns don't match, rather than terminating the command
gsh now prints "No match: <pattern> ignored" and passes the command line
minus the unmatched patterns on to be executed.
* Modified echo command so it doesn't add a blank to the end.
* Make "clear" and "source" built-ins non-forked commands. Unforking
"source" allows prefixes to be set in files that are sourced.
* Add loop to parse a single command (removing leading whitespace) before
sending it off to be expanded and executed. Skip null lines and comments
at this level. This allows later commands that depend upon variables set
in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
Also fixes problems seen when tab was first character of multiple lines.
* Initialize environment variable flags at startup (for echo, nodirexec,
nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
flag when env var is set in upper or lower case (formerly, only worked
with lower case).
* Lots of places two-word addresses are incremented using inc, without
checking for overflow into the high-order word. As these are discovered,
they are changed to use adc on both words.
See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
|
|
|
nextvar unlock setmutex
|
1997-11-18 05:31:00 +00:00
|
|
|
skipvar add2 argv,#4,argv
|
|
|
|
dec argc
|
|
|
|
jmp setvar
|
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
;
|
|
|
|
; Display the value of a single variable
|
|
|
|
;
|
|
|
|
showonevar anop
|
|
|
|
|
|
|
|
jsl alloc1024 Allocate 1024 bytes
|
|
|
|
sta valbuf for result buffer.
|
|
|
|
sta RSvalue
|
|
|
|
stx valbuf+2
|
|
|
|
stx RSvalue+2
|
|
|
|
ora valbuf+2 Check for memory error.
|
|
|
|
jeq nextvar
|
|
|
|
lda #1022 Store max len == 1022 in result
|
|
|
|
sta [valbuf] buffer (save 2 bytes at end for 0).
|
|
|
|
|
|
|
|
pei (arg+2) Create GS/OS string that
|
|
|
|
pei (arg) contains the variable name.
|
|
|
|
jsr c2gsstr
|
|
|
|
sta varbuf
|
|
|
|
stx varbuf+2
|
|
|
|
sta RSname
|
|
|
|
stx RSname+2
|
1998-09-08 16:53:14 +00:00
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
stz RSexport
|
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
ReadVariableGS ReadSetVar Read value of variable.
|
1998-07-20 16:23:11 +00:00
|
|
|
|
|
|
|
lda RSexport If export flag is set, it's defined.
|
|
|
|
bne def
|
|
|
|
lda exflag If export is required,
|
|
|
|
bne notdef report 'not defined'.
|
|
|
|
ldy #2
|
|
|
|
lda [valbuf],y If there is no value length
|
|
|
|
bne def print error message:
|
|
|
|
|
|
|
|
notdef ldx #^error2 'Variable not defined'
|
|
|
|
lda #error2
|
|
|
|
jsr errputs
|
1998-12-21 23:57:08 +00:00
|
|
|
inc status Return status = 1.
|
1998-07-20 16:23:11 +00:00
|
|
|
bra doneone
|
|
|
|
|
|
|
|
def ldx RSexport X = export flag.
|
1998-08-03 17:30:30 +00:00
|
|
|
ldy #2 Y = offset in varname to text.
|
1998-07-20 16:23:11 +00:00
|
|
|
jsr prnameval Print varname and varval.
|
|
|
|
|
|
|
|
doneone anop
|
|
|
|
ldx valbuf+2
|
|
|
|
lda valbuf
|
|
|
|
jsl free1024 Free valbuf.
|
1998-09-08 16:53:14 +00:00
|
|
|
ph4 varbuf
|
1998-07-20 16:23:11 +00:00
|
|
|
jsl nullfree Free varbuf.
|
|
|
|
|
|
|
|
|
Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
of expanded $HOME match the user's delimiter.
* When wildcard patterns don't match, rather than terminating the command
gsh now prints "No match: <pattern> ignored" and passes the command line
minus the unmatched patterns on to be executed.
* Modified echo command so it doesn't add a blank to the end.
* Make "clear" and "source" built-ins non-forked commands. Unforking
"source" allows prefixes to be set in files that are sourced.
* Add loop to parse a single command (removing leading whitespace) before
sending it off to be expanded and executed. Skip null lines and comments
at this level. This allows later commands that depend upon variables set
in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
Also fixes problems seen when tab was first character of multiple lines.
* Initialize environment variable flags at startup (for echo, nodirexec,
nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
flag when env var is set in upper or lower case (formerly, only worked
with lower case).
* Lots of places two-word addresses are incremented using inc, without
checking for overflow into the high-order word. As these are discovered,
they are changed to use adc on both words.
See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
|
|
|
doneset unlock setmutex
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-12-21 23:57:08 +00:00
|
|
|
exit ldy status
|
|
|
|
lda space
|
1997-11-18 05:31:00 +00:00
|
|
|
sta end-3
|
|
|
|
lda space+1
|
|
|
|
sta end-2
|
|
|
|
pld
|
|
|
|
tsc
|
|
|
|
adc #end-4
|
|
|
|
tcs
|
|
|
|
|
1998-12-21 23:57:08 +00:00
|
|
|
tya Return status
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
rtl
|
1997-11-18 05:31:00 +00:00
|
|
|
|
|
|
|
;
|
1998-07-20 16:23:11 +00:00
|
|
|
; Utility subroutine to print name and value in varname and varval
|
1998-08-03 17:30:30 +00:00
|
|
|
; Call with X = export flag, Y = index to text in varbuf.
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
1998-07-20 16:23:11 +00:00
|
|
|
prnameval anop
|
|
|
|
phy Hold name length offset on stack.
|
|
|
|
cpx #0 If export flag is set,
|
|
|
|
bne needshift go upshift the name.
|
|
|
|
ldx exflag If we're listing all vars, it's OK.
|
|
|
|
beq nameok
|
|
|
|
ply Otherwise, remove length offset
|
|
|
|
bra goback and skip the printing.
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
1998-07-20 16:23:11 +00:00
|
|
|
; Variable is exported: need to upshift its name:
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
1998-08-03 17:30:30 +00:00
|
|
|
needshift short a Switch to 1-byte memory access.
|
1998-07-20 16:23:11 +00:00
|
|
|
|
|
|
|
upper lda [varbuf],y Get next character.
|
1998-08-03 17:30:30 +00:00
|
|
|
beq golong If 0, at end.
|
1998-07-20 16:23:11 +00:00
|
|
|
cmp #'a' If >= 'a'
|
|
|
|
bcc noshift and <= 'z',
|
1997-11-18 05:31:00 +00:00
|
|
|
cmp #'z'+1
|
1998-07-20 16:23:11 +00:00
|
|
|
bcs noshift
|
|
|
|
and #$5F upshift the char.
|
|
|
|
sta [varbuf],y
|
|
|
|
noshift iny Bump the index and
|
1998-08-03 17:30:30 +00:00
|
|
|
bra upper stay in upshift loop until done.
|
1998-07-20 16:23:11 +00:00
|
|
|
|
1998-08-03 17:30:30 +00:00
|
|
|
golong long a Switch back to 1-word access.
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
1998-07-20 16:23:11 +00:00
|
|
|
; Name is ready for printing
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
1998-07-20 16:23:11 +00:00
|
|
|
nameok ldx varbuf+2
|
|
|
|
clc
|
1998-08-03 17:30:30 +00:00
|
|
|
pla Get text offset from stack.
|
1998-07-20 16:23:11 +00:00
|
|
|
adc varbuf Add starting address,
|
|
|
|
bcc prname
|
|
|
|
inx adjusting high-order word if needed.
|
1998-08-03 17:30:30 +00:00
|
|
|
prname jsr puts Print name
|
1997-11-18 05:31:00 +00:00
|
|
|
|
|
|
|
ldx #^showeq
|
1998-07-20 16:23:11 +00:00
|
|
|
lda #showeq
|
|
|
|
jsr puts Print " = "
|
|
|
|
|
|
|
|
ldy #2 Get length word of value.
|
|
|
|
lda [valbuf],y If zero,
|
|
|
|
beq newln skip printing the value.
|
|
|
|
tay Set Y to point to the end of the string.
|
|
|
|
iny4
|
|
|
|
lda #0 Store zero word at end so it can
|
|
|
|
sta [valbuf],y be treated like a c-string.
|
1997-11-18 05:31:00 +00:00
|
|
|
lda valbuf
|
1998-07-20 16:23:11 +00:00
|
|
|
ldx valbuf+2
|
|
|
|
clc
|
|
|
|
adc #4
|
|
|
|
bcc prval
|
|
|
|
inx
|
|
|
|
prval jsr puts Print value (c-string).
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
newln jsr newline Print blank line.
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
goback rts Return to caller
|
1997-11-18 05:31:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
; Parameter block for shell ReadVariableGS/SetGS calls
|
|
|
|
ReadSetVar anop
|
|
|
|
dc i2'3' pCount
|
|
|
|
RSname ds 4 Name (pointer to GS/OS string)
|
|
|
|
RSvalue ds 4 Value (ptr to result buf or string)
|
|
|
|
RSexport ds 2 Export flag
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
; Parameter block for shell ReadIndexedGS call (p 421 in ORCA/M manual)
|
|
|
|
idxParm anop
|
|
|
|
dc i2'4' pCount
|
|
|
|
idxName ds 4 Name (pointer to GS/OS result buf)
|
|
|
|
idxValue ds 4 Value (pointer to GS/OS result buf)
|
|
|
|
idxIndex ds 2 Index number
|
|
|
|
idxExport ds 2 Export flag
|
1997-11-18 05:31:00 +00:00
|
|
|
|
|
|
|
|
Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
of expanded $HOME match the user's delimiter.
* When wildcard patterns don't match, rather than terminating the command
gsh now prints "No match: <pattern> ignored" and passes the command line
minus the unmatched patterns on to be executed.
* Modified echo command so it doesn't add a blank to the end.
* Make "clear" and "source" built-ins non-forked commands. Unforking
"source" allows prefixes to be set in files that are sourced.
* Add loop to parse a single command (removing leading whitespace) before
sending it off to be expanded and executed. Skip null lines and comments
at this level. This allows later commands that depend upon variables set
in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
Also fixes problems seen when tab was first character of multiple lines.
* Initialize environment variable flags at startup (for echo, nodirexec,
nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
flag when env var is set in upper or lower case (formerly, only worked
with lower case).
* Lots of places two-word addresses are incremented using inc, without
checking for overflow into the high-order word. As these are discovered,
they are changed to use adc on both words.
See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
|
|
|
setmutex key
|
1997-11-18 05:31:00 +00:00
|
|
|
showeq dc c' = ',h'00'
|
|
|
|
Usage dc c'Usage:',h'0d'
|
1998-07-20 16:23:11 +00:00
|
|
|
dc c' set - displays all variables',h'0d'
|
|
|
|
dc c' set ... [var] - displays the value of var',h'0d'
|
|
|
|
dc c' set [var value]... - sets var to value',h'0d'
|
|
|
|
dc c' set [var=value]... - sets var to value',h'0d'
|
|
|
|
dc h'00'
|
|
|
|
error1 dc c'set: Variable not specified',h'0d00'
|
|
|
|
error2 dc c'set: Variable not defined',h'0d00'
|
1997-11-18 05:31:00 +00:00
|
|
|
|
Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
of expanded $HOME match the user's delimiter.
* When wildcard patterns don't match, rather than terminating the command
gsh now prints "No match: <pattern> ignored" and passes the command line
minus the unmatched patterns on to be executed.
* Modified echo command so it doesn't add a blank to the end.
* Make "clear" and "source" built-ins non-forked commands. Unforking
"source" allows prefixes to be set in files that are sourced.
* Add loop to parse a single command (removing leading whitespace) before
sending it off to be expanded and executed. Skip null lines and comments
at this level. This allows later commands that depend upon variables set
in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
Also fixes problems seen when tab was first character of multiple lines.
* Initialize environment variable flags at startup (for echo, nodirexec,
nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
flag when env var is set in upper or lower case (formerly, only worked
with lower case).
* Lots of places two-word addresses are incremented using inc, without
checking for overflow into the high-order word. As these are discovered,
they are changed to use adc on both words.
See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
|
|
|
; Parameter block for shell ErrorGS call (p 393 in ORCA/M manual)
|
|
|
|
Err dc i2'1' pCount
|
|
|
|
ErrError ds 2 Error number
|
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
END
|
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
**************************************************************************
|
|
|
|
*
|
|
|
|
* EXPORT: builtin command
|
|
|
|
* syntax: export [var] ...
|
|
|
|
*
|
|
|
|
* exports each variable given in the list
|
|
|
|
*
|
|
|
|
**************************************************************************
|
|
|
|
|
|
|
|
export START
|
|
|
|
|
1998-12-21 23:57:08 +00:00
|
|
|
status equ 0
|
|
|
|
space equ status+2
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-12-21 23:57:08 +00:00
|
|
|
subroutine (4:argv,2:argc),space
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-12-21 23:57:08 +00:00
|
|
|
stz status
|
1998-07-20 16:23:11 +00:00
|
|
|
lda argc Get parameter count.
|
|
|
|
dec a If < 1
|
1997-11-18 05:31:00 +00:00
|
|
|
bne loop
|
1998-07-20 16:23:11 +00:00
|
|
|
ldx #^Usage Print usage string
|
1997-11-18 05:31:00 +00:00
|
|
|
lda #Usage
|
|
|
|
jsr errputs
|
1998-12-21 23:57:08 +00:00
|
|
|
inc status
|
1998-07-20 16:23:11 +00:00
|
|
|
bra done and terminate.
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
;
|
|
|
|
; Loop to process all the variables to export
|
|
|
|
;
|
|
|
|
loop anop
|
|
|
|
dec argc Decrement argument counter.
|
|
|
|
beq done If zero, all done.
|
|
|
|
add4 argv,#4,argv Bump argument address pointer.
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
lock expmutex
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
ldy #2 Convert argv string
|
|
|
|
lda [argv],y from c-string
|
|
|
|
pha to a GS/OS string.
|
1997-11-18 05:31:00 +00:00
|
|
|
lda [argv]
|
|
|
|
pha
|
1998-07-20 16:23:11 +00:00
|
|
|
jsr c2gsstr
|
|
|
|
sta ExpName Store result in
|
|
|
|
stx ExpName+2 ExportGS parameter block.
|
|
|
|
|
|
|
|
ExportGS ExportPB Export the named parameter
|
|
|
|
|
|
|
|
ph4 ExpName Deallocate the GS/OS string.
|
1997-11-18 05:31:00 +00:00
|
|
|
jsl nullfree
|
|
|
|
|
Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
of expanded $HOME match the user's delimiter.
* When wildcard patterns don't match, rather than terminating the command
gsh now prints "No match: <pattern> ignored" and passes the command line
minus the unmatched patterns on to be executed.
* Modified echo command so it doesn't add a blank to the end.
* Make "clear" and "source" built-ins non-forked commands. Unforking
"source" allows prefixes to be set in files that are sourced.
* Add loop to parse a single command (removing leading whitespace) before
sending it off to be expanded and executed. Skip null lines and comments
at this level. This allows later commands that depend upon variables set
in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
Also fixes problems seen when tab was first character of multiple lines.
* Initialize environment variable flags at startup (for echo, nodirexec,
nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
flag when env var is set in upper or lower case (formerly, only worked
with lower case).
* Lots of places two-word addresses are incremented using inc, without
checking for overflow into the high-order word. As these are discovered,
they are changed to use adc on both words.
See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
|
|
|
unlock expmutex
|
1997-11-18 05:31:00 +00:00
|
|
|
|
|
|
|
bra loop
|
|
|
|
|
1998-12-21 23:57:08 +00:00
|
|
|
done return 2:status
|
1997-11-18 05:31:00 +00:00
|
|
|
|
Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
of expanded $HOME match the user's delimiter.
* When wildcard patterns don't match, rather than terminating the command
gsh now prints "No match: <pattern> ignored" and passes the command line
minus the unmatched patterns on to be executed.
* Modified echo command so it doesn't add a blank to the end.
* Make "clear" and "source" built-ins non-forked commands. Unforking
"source" allows prefixes to be set in files that are sourced.
* Add loop to parse a single command (removing leading whitespace) before
sending it off to be expanded and executed. Skip null lines and comments
at this level. This allows later commands that depend upon variables set
in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
Also fixes problems seen when tab was first character of multiple lines.
* Initialize environment variable flags at startup (for echo, nodirexec,
nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
flag when env var is set in upper or lower case (formerly, only worked
with lower case).
* Lots of places two-word addresses are incremented using inc, without
checking for overflow into the high-order word. As these are discovered,
they are changed to use adc on both words.
See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
|
|
|
expmutex key
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
;
|
|
|
|
; Parameter block for shell ExportGS call (p 398 in ORCA/M manual)
|
|
|
|
;
|
|
|
|
ExportPB anop
|
|
|
|
dc i2'2' pCount
|
|
|
|
ExpName ds 4 Name (pointer to GS/OS string)
|
|
|
|
dc i2'1' Export flag (always on)
|
1997-11-18 05:31:00 +00:00
|
|
|
|
|
|
|
Usage dc c'Usage: export var ...',h'0d00'
|
|
|
|
|
|
|
|
END
|
|
|
|
|
|
|
|
**************************************************************************
|
|
|
|
*
|
|
|
|
* UNSET: builtin command
|
|
|
|
* syntax: unset [var] ...
|
|
|
|
*
|
|
|
|
* unsets each variable given in the list
|
|
|
|
*
|
|
|
|
**************************************************************************
|
|
|
|
|
|
|
|
unset START
|
|
|
|
|
1998-12-21 23:57:08 +00:00
|
|
|
status equ 0
|
|
|
|
space equ status+2
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-12-21 23:57:08 +00:00
|
|
|
subroutine (4:argv,2:argc),space
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-12-21 23:57:08 +00:00
|
|
|
stz status
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
lda argc Get parameter count.
|
|
|
|
dec a If < 1
|
1997-11-18 05:31:00 +00:00
|
|
|
bne loop
|
1998-07-20 16:23:11 +00:00
|
|
|
ldx #^Usage Print usage string
|
1997-11-18 05:31:00 +00:00
|
|
|
lda #Usage
|
|
|
|
jsr errputs
|
1998-12-21 23:57:08 +00:00
|
|
|
inc status set return status = 1
|
|
|
|
bra done and terminate.
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
;
|
|
|
|
; Loop to process all the variables to export
|
|
|
|
;
|
|
|
|
loop anop
|
|
|
|
dec argc Decrement argument counter.
|
|
|
|
beq done If zero, all done.
|
|
|
|
add4 argv,#4,argv Bump argument address pointer.
|
1997-11-18 05:31:00 +00:00
|
|
|
|
Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
of expanded $HOME match the user's delimiter.
* When wildcard patterns don't match, rather than terminating the command
gsh now prints "No match: <pattern> ignored" and passes the command line
minus the unmatched patterns on to be executed.
* Modified echo command so it doesn't add a blank to the end.
* Make "clear" and "source" built-ins non-forked commands. Unforking
"source" allows prefixes to be set in files that are sourced.
* Add loop to parse a single command (removing leading whitespace) before
sending it off to be expanded and executed. Skip null lines and comments
at this level. This allows later commands that depend upon variables set
in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
Also fixes problems seen when tab was first character of multiple lines.
* Initialize environment variable flags at startup (for echo, nodirexec,
nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
flag when env var is set in upper or lower case (formerly, only worked
with lower case).
* Lots of places two-word addresses are incremented using inc, without
checking for overflow into the high-order word. As these are discovered,
they are changed to use adc on both words.
See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
|
|
|
lock unsmutex
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
ldy #2 Convert argv string
|
|
|
|
lda [argv],y from c-string
|
|
|
|
pha to a GS/OS string.
|
1997-11-18 05:31:00 +00:00
|
|
|
lda [argv]
|
|
|
|
pha
|
1998-07-20 16:23:11 +00:00
|
|
|
jsr c2gsstr
|
|
|
|
sta UnsetName Store result in
|
|
|
|
stx UnsetName+2 UnsetVariableGS param block.
|
|
|
|
|
|
|
|
UnsetVariableGS UnsetPB Unset the named parameter.
|
|
|
|
|
|
|
|
ph4 UnsetName Deallocate the GS/OS string.
|
|
|
|
jsl nullfree
|
|
|
|
|
|
|
|
ldy #2 Update special shell flags.
|
|
|
|
lda [argv],y
|
1997-11-18 05:31:00 +00:00
|
|
|
pha
|
1998-07-20 16:23:11 +00:00
|
|
|
lda [argv]
|
1997-11-18 05:31:00 +00:00
|
|
|
pha
|
1998-07-20 16:23:11 +00:00
|
|
|
pea 0
|
1997-11-18 05:31:00 +00:00
|
|
|
jsl updatevars
|
|
|
|
|
Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
of expanded $HOME match the user's delimiter.
* When wildcard patterns don't match, rather than terminating the command
gsh now prints "No match: <pattern> ignored" and passes the command line
minus the unmatched patterns on to be executed.
* Modified echo command so it doesn't add a blank to the end.
* Make "clear" and "source" built-ins non-forked commands. Unforking
"source" allows prefixes to be set in files that are sourced.
* Add loop to parse a single command (removing leading whitespace) before
sending it off to be expanded and executed. Skip null lines and comments
at this level. This allows later commands that depend upon variables set
in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
Also fixes problems seen when tab was first character of multiple lines.
* Initialize environment variable flags at startup (for echo, nodirexec,
nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
flag when env var is set in upper or lower case (formerly, only worked
with lower case).
* Lots of places two-word addresses are incremented using inc, without
checking for overflow into the high-order word. As these are discovered,
they are changed to use adc on both words.
See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
|
|
|
unlock unsmutex
|
1997-11-18 05:31:00 +00:00
|
|
|
|
|
|
|
bra loop
|
|
|
|
|
1998-12-21 23:57:08 +00:00
|
|
|
done return 2:status
|
1997-11-18 05:31:00 +00:00
|
|
|
|
Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
of expanded $HOME match the user's delimiter.
* When wildcard patterns don't match, rather than terminating the command
gsh now prints "No match: <pattern> ignored" and passes the command line
minus the unmatched patterns on to be executed.
* Modified echo command so it doesn't add a blank to the end.
* Make "clear" and "source" built-ins non-forked commands. Unforking
"source" allows prefixes to be set in files that are sourced.
* Add loop to parse a single command (removing leading whitespace) before
sending it off to be expanded and executed. Skip null lines and comments
at this level. This allows later commands that depend upon variables set
in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
Also fixes problems seen when tab was first character of multiple lines.
* Initialize environment variable flags at startup (for echo, nodirexec,
nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
flag when env var is set in upper or lower case (formerly, only worked
with lower case).
* Lots of places two-word addresses are incremented using inc, without
checking for overflow into the high-order word. As these are discovered,
they are changed to use adc on both words.
See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
|
|
|
unsmutex key
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
;
|
|
|
|
; Parameter block for shell UnsetVariableGS call (p 439 in ORCA/M manual)
|
|
|
|
;
|
|
|
|
UnsetPB anop
|
|
|
|
dc i2'2' pCount
|
|
|
|
UnsetName ds 4 Name (pointer to GS/OS string)
|
1997-11-18 05:31:00 +00:00
|
|
|
|
|
|
|
Usage dc c'Usage: unset var ...',h'0d00'
|
|
|
|
|
|
|
|
END
|
|
|
|
|
|
|
|
;====================================================================
|
|
|
|
;
|
|
|
|
; update shell variable flags
|
|
|
|
;
|
|
|
|
;====================================================================
|
|
|
|
|
|
|
|
updatevars START
|
|
|
|
|
|
|
|
using vardata
|
|
|
|
|
|
|
|
space equ 0
|
|
|
|
|
|
|
|
subroutine (4:var,2:flag),space ;flag 1: set, 0: unset
|
|
|
|
|
|
|
|
pei (var+2)
|
|
|
|
pei (var)
|
|
|
|
ph4 #varechoname
|
Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
of expanded $HOME match the user's delimiter.
* When wildcard patterns don't match, rather than terminating the command
gsh now prints "No match: <pattern> ignored" and passes the command line
minus the unmatched patterns on to be executed.
* Modified echo command so it doesn't add a blank to the end.
* Make "clear" and "source" built-ins non-forked commands. Unforking
"source" allows prefixes to be set in files that are sourced.
* Add loop to parse a single command (removing leading whitespace) before
sending it off to be expanded and executed. Skip null lines and comments
at this level. This allows later commands that depend upon variables set
in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
Also fixes problems seen when tab was first character of multiple lines.
* Initialize environment variable flags at startup (for echo, nodirexec,
nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
flag when env var is set in upper or lower case (formerly, only worked
with lower case).
* Lots of places two-word addresses are incremented using inc, without
checking for overflow into the high-order word. As these are discovered,
they are changed to use adc on both words.
See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
|
|
|
jsr cmpdcstr
|
1997-11-18 05:31:00 +00:00
|
|
|
bne up2
|
|
|
|
lda flag
|
|
|
|
sta varecho
|
|
|
|
jmp done
|
|
|
|
|
|
|
|
up2 pei (var+2)
|
|
|
|
pei (var)
|
|
|
|
ph4 #direxecname
|
Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
of expanded $HOME match the user's delimiter.
* When wildcard patterns don't match, rather than terminating the command
gsh now prints "No match: <pattern> ignored" and passes the command line
minus the unmatched patterns on to be executed.
* Modified echo command so it doesn't add a blank to the end.
* Make "clear" and "source" built-ins non-forked commands. Unforking
"source" allows prefixes to be set in files that are sourced.
* Add loop to parse a single command (removing leading whitespace) before
sending it off to be expanded and executed. Skip null lines and comments
at this level. This allows later commands that depend upon variables set
in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
Also fixes problems seen when tab was first character of multiple lines.
* Initialize environment variable flags at startup (for echo, nodirexec,
nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
flag when env var is set in upper or lower case (formerly, only worked
with lower case).
* Lots of places two-word addresses are incremented using inc, without
checking for overflow into the high-order word. As these are discovered,
they are changed to use adc on both words.
See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
|
|
|
jsr cmpdcstr
|
1997-11-18 05:31:00 +00:00
|
|
|
bne up3
|
|
|
|
lda flag
|
|
|
|
sta vardirexec
|
|
|
|
jmp done
|
|
|
|
|
|
|
|
up3 pei (var+2)
|
|
|
|
pei (var)
|
|
|
|
ph4 #newlinename
|
Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
of expanded $HOME match the user's delimiter.
* When wildcard patterns don't match, rather than terminating the command
gsh now prints "No match: <pattern> ignored" and passes the command line
minus the unmatched patterns on to be executed.
* Modified echo command so it doesn't add a blank to the end.
* Make "clear" and "source" built-ins non-forked commands. Unforking
"source" allows prefixes to be set in files that are sourced.
* Add loop to parse a single command (removing leading whitespace) before
sending it off to be expanded and executed. Skip null lines and comments
at this level. This allows later commands that depend upon variables set
in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
Also fixes problems seen when tab was first character of multiple lines.
* Initialize environment variable flags at startup (for echo, nodirexec,
nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
flag when env var is set in upper or lower case (formerly, only worked
with lower case).
* Lots of places two-word addresses are incremented using inc, without
checking for overflow into the high-order word. As these are discovered,
they are changed to use adc on both words.
See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
|
|
|
jsr cmpdcstr
|
1997-11-18 05:31:00 +00:00
|
|
|
bne up4
|
|
|
|
lda flag
|
|
|
|
sta varnewline
|
|
|
|
jmp done
|
|
|
|
|
|
|
|
up4 pei (var+2)
|
|
|
|
pei (var)
|
|
|
|
ph4 #noglobname
|
Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
of expanded $HOME match the user's delimiter.
* When wildcard patterns don't match, rather than terminating the command
gsh now prints "No match: <pattern> ignored" and passes the command line
minus the unmatched patterns on to be executed.
* Modified echo command so it doesn't add a blank to the end.
* Make "clear" and "source" built-ins non-forked commands. Unforking
"source" allows prefixes to be set in files that are sourced.
* Add loop to parse a single command (removing leading whitespace) before
sending it off to be expanded and executed. Skip null lines and comments
at this level. This allows later commands that depend upon variables set
in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
Also fixes problems seen when tab was first character of multiple lines.
* Initialize environment variable flags at startup (for echo, nodirexec,
nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
flag when env var is set in upper or lower case (formerly, only worked
with lower case).
* Lots of places two-word addresses are incremented using inc, without
checking for overflow into the high-order word. As these are discovered,
they are changed to use adc on both words.
See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
|
|
|
jsr cmpdcstr
|
1997-11-18 05:31:00 +00:00
|
|
|
bne up5
|
|
|
|
lda flag
|
|
|
|
sta varnoglob
|
|
|
|
jmp done
|
|
|
|
|
|
|
|
up5 pei (var+2)
|
|
|
|
pei (var)
|
|
|
|
ph4 #nobeepname
|
Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
of expanded $HOME match the user's delimiter.
* When wildcard patterns don't match, rather than terminating the command
gsh now prints "No match: <pattern> ignored" and passes the command line
minus the unmatched patterns on to be executed.
* Modified echo command so it doesn't add a blank to the end.
* Make "clear" and "source" built-ins non-forked commands. Unforking
"source" allows prefixes to be set in files that are sourced.
* Add loop to parse a single command (removing leading whitespace) before
sending it off to be expanded and executed. Skip null lines and comments
at this level. This allows later commands that depend upon variables set
in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
Also fixes problems seen when tab was first character of multiple lines.
* Initialize environment variable flags at startup (for echo, nodirexec,
nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
flag when env var is set in upper or lower case (formerly, only worked
with lower case).
* Lots of places two-word addresses are incremented using inc, without
checking for overflow into the high-order word. As these are discovered,
they are changed to use adc on both words.
See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
|
|
|
jsr cmpdcstr
|
1997-11-18 05:31:00 +00:00
|
|
|
bne up6
|
|
|
|
lda flag
|
|
|
|
sta varnobeep
|
|
|
|
jmp done
|
|
|
|
|
|
|
|
up6 pei (var+2)
|
|
|
|
pei (var)
|
|
|
|
ph4 #pushdsilname
|
Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
of expanded $HOME match the user's delimiter.
* When wildcard patterns don't match, rather than terminating the command
gsh now prints "No match: <pattern> ignored" and passes the command line
minus the unmatched patterns on to be executed.
* Modified echo command so it doesn't add a blank to the end.
* Make "clear" and "source" built-ins non-forked commands. Unforking
"source" allows prefixes to be set in files that are sourced.
* Add loop to parse a single command (removing leading whitespace) before
sending it off to be expanded and executed. Skip null lines and comments
at this level. This allows later commands that depend upon variables set
in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
Also fixes problems seen when tab was first character of multiple lines.
* Initialize environment variable flags at startup (for echo, nodirexec,
nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
flag when env var is set in upper or lower case (formerly, only worked
with lower case).
* Lots of places two-word addresses are incremented using inc, without
checking for overflow into the high-order word. As these are discovered,
they are changed to use adc on both words.
See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
|
|
|
jsr cmpdcstr
|
1997-11-18 05:31:00 +00:00
|
|
|
bne up7
|
|
|
|
lda flag
|
|
|
|
sta varpushdsil
|
|
|
|
jmp done
|
|
|
|
|
|
|
|
up7 pei (var+2)
|
|
|
|
pei (var)
|
|
|
|
ph4 #termname
|
Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
of expanded $HOME match the user's delimiter.
* When wildcard patterns don't match, rather than terminating the command
gsh now prints "No match: <pattern> ignored" and passes the command line
minus the unmatched patterns on to be executed.
* Modified echo command so it doesn't add a blank to the end.
* Make "clear" and "source" built-ins non-forked commands. Unforking
"source" allows prefixes to be set in files that are sourced.
* Add loop to parse a single command (removing leading whitespace) before
sending it off to be expanded and executed. Skip null lines and comments
at this level. This allows later commands that depend upon variables set
in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
Also fixes problems seen when tab was first character of multiple lines.
* Initialize environment variable flags at startup (for echo, nodirexec,
nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
flag when env var is set in upper or lower case (formerly, only worked
with lower case).
* Lots of places two-word addresses are incremented using inc, without
checking for overflow into the high-order word. As these are discovered,
they are changed to use adc on both words.
See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
|
|
|
jsr cmpdcstr
|
1997-11-18 05:31:00 +00:00
|
|
|
bne up8
|
|
|
|
jsr readterm
|
|
|
|
jmp done
|
|
|
|
|
|
|
|
up8 pei (var+2)
|
|
|
|
pei (var)
|
|
|
|
ph4 #ignorename
|
Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
of expanded $HOME match the user's delimiter.
* When wildcard patterns don't match, rather than terminating the command
gsh now prints "No match: <pattern> ignored" and passes the command line
minus the unmatched patterns on to be executed.
* Modified echo command so it doesn't add a blank to the end.
* Make "clear" and "source" built-ins non-forked commands. Unforking
"source" allows prefixes to be set in files that are sourced.
* Add loop to parse a single command (removing leading whitespace) before
sending it off to be expanded and executed. Skip null lines and comments
at this level. This allows later commands that depend upon variables set
in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
Also fixes problems seen when tab was first character of multiple lines.
* Initialize environment variable flags at startup (for echo, nodirexec,
nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
flag when env var is set in upper or lower case (formerly, only worked
with lower case).
* Lots of places two-word addresses are incremented using inc, without
checking for overflow into the high-order word. As these are discovered,
they are changed to use adc on both words.
See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
|
|
|
jsr cmpdcstr
|
1997-11-18 05:31:00 +00:00
|
|
|
bne up9
|
|
|
|
lda flag
|
|
|
|
sta varignore
|
|
|
|
jmp done
|
|
|
|
|
|
|
|
up9 anop
|
1998-07-20 16:23:11 +00:00
|
|
|
pei (var+2)
|
|
|
|
pei (var)
|
|
|
|
ph4 #oldpmodename
|
|
|
|
jsr cmpdcstr
|
|
|
|
bne done
|
|
|
|
lda flag
|
|
|
|
sta varoldpmode
|
1998-09-08 16:53:14 +00:00
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
done return
|
|
|
|
|
|
|
|
END
|
|
|
|
|
Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
of expanded $HOME match the user's delimiter.
* When wildcard patterns don't match, rather than terminating the command
gsh now prints "No match: <pattern> ignored" and passes the command line
minus the unmatched patterns on to be executed.
* Modified echo command so it doesn't add a blank to the end.
* Make "clear" and "source" built-ins non-forked commands. Unforking
"source" allows prefixes to be set in files that are sourced.
* Add loop to parse a single command (removing leading whitespace) before
sending it off to be expanded and executed. Skip null lines and comments
at this level. This allows later commands that depend upon variables set
in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
Also fixes problems seen when tab was first character of multiple lines.
* Initialize environment variable flags at startup (for echo, nodirexec,
nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
flag when env var is set in upper or lower case (formerly, only worked
with lower case).
* Lots of places two-word addresses are incremented using inc, without
checking for overflow into the high-order word. As these are discovered,
they are changed to use adc on both words.
See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
|
|
|
;====================================================================
|
|
|
|
;
|
|
|
|
; Update all shell variable flags from environment
|
|
|
|
;
|
|
|
|
;====================================================================
|
|
|
|
|
|
|
|
InitVars START
|
|
|
|
|
|
|
|
using vardata
|
|
|
|
|
|
|
|
lock gvmutex Mutual exclusion lock.
|
|
|
|
|
|
|
|
ldx #0 Use X-reg to index value table.
|
|
|
|
loop phx Hold onto value table index.
|
|
|
|
txa
|
|
|
|
asl a Double the value array index
|
|
|
|
tax to get addr table index.
|
|
|
|
lda evstrtbl,x Store address of variable name
|
|
|
|
sta RVname in ReadVariableGS parameter block.
|
|
|
|
lda evstrtbl+2,x
|
|
|
|
sta RVname+2
|
|
|
|
stz RVexpflag Clear export flag.
|
|
|
|
|
|
|
|
ReadVariableGS ReadVar Read the value of the named variable.
|
|
|
|
|
|
|
|
plx Restore value table index.
|
|
|
|
lda RBlen If variable length != 0
|
|
|
|
bne set it is set.
|
|
|
|
lda RVexpflag It could be exported with len = 0.
|
|
|
|
set sta evvaltbl,x Save flag in variable.
|
|
|
|
inx2 Bump index.
|
|
|
|
cpx evvaltblsz If not at end,
|
1998-09-08 16:53:14 +00:00
|
|
|
bcc loop stay in loop.
|
Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
of expanded $HOME match the user's delimiter.
* When wildcard patterns don't match, rather than terminating the command
gsh now prints "No match: <pattern> ignored" and passes the command line
minus the unmatched patterns on to be executed.
* Modified echo command so it doesn't add a blank to the end.
* Make "clear" and "source" built-ins non-forked commands. Unforking
"source" allows prefixes to be set in files that are sourced.
* Add loop to parse a single command (removing leading whitespace) before
sending it off to be expanded and executed. Skip null lines and comments
at this level. This allows later commands that depend upon variables set
in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
Also fixes problems seen when tab was first character of multiple lines.
* Initialize environment variable flags at startup (for echo, nodirexec,
nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
flag when env var is set in upper or lower case (formerly, only worked
with lower case).
* Lots of places two-word addresses are incremented using inc, without
checking for overflow into the high-order word. As these are discovered,
they are changed to use adc on both words.
See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
|
|
|
|
|
|
|
unlock gvmutex Mutual exclusion unlock.
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
gvmutex key Key for mutual exclusion.
|
|
|
|
|
|
|
|
; Parameter block for shell ReadVariableGS call (p 423 in ORCA/M manual)
|
|
|
|
ReadVar anop
|
|
|
|
dc i2'3' pCount
|
|
|
|
RVname ds 4 Pointer to name
|
|
|
|
RVresult dc a4'ResultBuf' GS/OS Output buffer ptr
|
|
|
|
RVexpflag ds 2 export flag
|
|
|
|
|
|
|
|
; GS/OS result buffer for testing whether a variable is defined.
|
|
|
|
; It doesn't have enough room for > 1 byte to be returned, but we
|
|
|
|
; only need to get the length of the value.
|
|
|
|
ResultBuf dc i2'5' Only five bytes total.
|
|
|
|
RBlen ds 2 Value's length returned here.
|
|
|
|
ds 1 Only 1 byte for value.
|
|
|
|
|
|
|
|
; GS/OS strings
|
|
|
|
echostr gsstr 'echo'
|
|
|
|
nodirexecstr gsstr 'nodirexec'
|
|
|
|
nonewlinestr gsstr 'nonewline'
|
|
|
|
noglobstr gsstr 'noglob'
|
|
|
|
nobeepstr gsstr 'nobeep'
|
|
|
|
pushdsilentstr gsstr 'pushdsilent'
|
|
|
|
termstr gsstr 'term'
|
|
|
|
ignoreofstr gsstr 'ignoreeof'
|
1998-07-20 16:23:11 +00:00
|
|
|
oldpathmodestr gsstr 'oldpathmode'
|
Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
of expanded $HOME match the user's delimiter.
* When wildcard patterns don't match, rather than terminating the command
gsh now prints "No match: <pattern> ignored" and passes the command line
minus the unmatched patterns on to be executed.
* Modified echo command so it doesn't add a blank to the end.
* Make "clear" and "source" built-ins non-forked commands. Unforking
"source" allows prefixes to be set in files that are sourced.
* Add loop to parse a single command (removing leading whitespace) before
sending it off to be expanded and executed. Skip null lines and comments
at this level. This allows later commands that depend upon variables set
in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
Also fixes problems seen when tab was first character of multiple lines.
* Initialize environment variable flags at startup (for echo, nodirexec,
nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
flag when env var is set in upper or lower case (formerly, only worked
with lower case).
* Lots of places two-word addresses are incremented using inc, without
checking for overflow into the high-order word. As these are discovered,
they are changed to use adc on both words.
See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
|
|
|
|
|
|
|
; Table of GS/OS string addresses
|
|
|
|
evstrtbl anop
|
|
|
|
dc a4'echostr'
|
|
|
|
dc a4'nodirexecstr'
|
|
|
|
dc a4'nonewlinestr'
|
|
|
|
dc a4'noglobstr'
|
|
|
|
dc a4'nobeepstr'
|
|
|
|
dc a4'pushdsilentstr'
|
|
|
|
dc a4'termstr'
|
|
|
|
dc a4'ignoreofstr'
|
1998-07-20 16:23:11 +00:00
|
|
|
dc a4'oldpathmodestr'
|
Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
of expanded $HOME match the user's delimiter.
* When wildcard patterns don't match, rather than terminating the command
gsh now prints "No match: <pattern> ignored" and passes the command line
minus the unmatched patterns on to be executed.
* Modified echo command so it doesn't add a blank to the end.
* Make "clear" and "source" built-ins non-forked commands. Unforking
"source" allows prefixes to be set in files that are sourced.
* Add loop to parse a single command (removing leading whitespace) before
sending it off to be expanded and executed. Skip null lines and comments
at this level. This allows later commands that depend upon variables set
in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
Also fixes problems seen when tab was first character of multiple lines.
* Initialize environment variable flags at startup (for echo, nodirexec,
nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
flag when env var is set in upper or lower case (formerly, only worked
with lower case).
* Lots of places two-word addresses are incremented using inc, without
checking for overflow into the high-order word. As these are discovered,
they are changed to use adc on both words.
See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
|
|
|
|
|
|
|
END
|
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
;===================================================================
|
|
|
|
;
|
|
|
|
; variable settings
|
|
|
|
;
|
|
|
|
;===================================================================
|
|
|
|
|
|
|
|
vardata DATA
|
|
|
|
|
|
|
|
varechoname dc c'echo',h'00'
|
|
|
|
direxecname dc c'nodirexec',h'00'
|
|
|
|
newlinename dc c'nonewline',h'00'
|
|
|
|
noglobname dc c'noglob',h'00'
|
|
|
|
nobeepname dc c'nobeep',h'00'
|
|
|
|
pushdsilname dc c'pushdsilent',h'00'
|
|
|
|
termname dc c'term',h'00'
|
|
|
|
ignorename dc c'ignoreeof',h'00'
|
1998-07-20 16:23:11 +00:00
|
|
|
oldpmodename dc c'oldpathmode',h'00'
|
1997-11-18 05:31:00 +00:00
|
|
|
|
Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
of expanded $HOME match the user's delimiter.
* When wildcard patterns don't match, rather than terminating the command
gsh now prints "No match: <pattern> ignored" and passes the command line
minus the unmatched patterns on to be executed.
* Modified echo command so it doesn't add a blank to the end.
* Make "clear" and "source" built-ins non-forked commands. Unforking
"source" allows prefixes to be set in files that are sourced.
* Add loop to parse a single command (removing leading whitespace) before
sending it off to be expanded and executed. Skip null lines and comments
at this level. This allows later commands that depend upon variables set
in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
Also fixes problems seen when tab was first character of multiple lines.
* Initialize environment variable flags at startup (for echo, nodirexec,
nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
flag when env var is set in upper or lower case (formerly, only worked
with lower case).
* Lots of places two-word addresses are incremented using inc, without
checking for overflow into the high-order word. As these are discovered,
they are changed to use adc on both words.
See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
|
|
|
; Table of flag values (must be in same order as string addresses)
|
|
|
|
evvaltbl anop
|
|
|
|
varecho dc i2'0'
|
|
|
|
vardirexec dc i2'0'
|
|
|
|
varnewline dc i2'0'
|
|
|
|
varnoglob dc i2'0'
|
|
|
|
varnobeep dc i2'0'
|
|
|
|
varpushdsil dc i2'0'
|
|
|
|
varignore dc i2'0'
|
1998-07-20 16:23:11 +00:00
|
|
|
varoldpmode dc i2'0'
|
Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
of expanded $HOME match the user's delimiter.
* When wildcard patterns don't match, rather than terminating the command
gsh now prints "No match: <pattern> ignored" and passes the command line
minus the unmatched patterns on to be executed.
* Modified echo command so it doesn't add a blank to the end.
* Make "clear" and "source" built-ins non-forked commands. Unforking
"source" allows prefixes to be set in files that are sourced.
* Add loop to parse a single command (removing leading whitespace) before
sending it off to be expanded and executed. Skip null lines and comments
at this level. This allows later commands that depend upon variables set
in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
Also fixes problems seen when tab was first character of multiple lines.
* Initialize environment variable flags at startup (for echo, nodirexec,
nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
flag when env var is set in upper or lower case (formerly, only worked
with lower case).
* Lots of places two-word addresses are incremented using inc, without
checking for overflow into the high-order word. As these are discovered,
they are changed to use adc on both words.
See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
|
|
|
|
|
|
|
evvaltblsz dc i2'evvaltblsz-evvaltbl' # bytes in table
|
1997-11-18 05:31:00 +00:00
|
|
|
|
|
|
|
END
|