[net.unix] question about sub-shell invoked by sg command

gill@wivax.UUCP (09/11/84)

I have been unable to find an answer to this in reading the manuals, and so
would like to ask if you know whether one can specify a command or group of
commands to be executed before the user gets control when a new shell is invoked
by the "sg" command.  That is, I wish to put this "sg" in a shell script and
have some commands executed by the new shell before the user gets control of
the shell at the terminal.

I am relatively new to UNIX.  My first attempt was the following:

	sg SAPRO
	cd /b/faculty/SAPRO
	umask 002
	source /b/faculty/SAPRO/COMMANDS/aliases
	#--------------------------------------------------
	# When moving back to parent shell (using CTL-D),
	# submit job to update SAPRO filelist
	#--------------------------------------------------
	sa-filelist

Of course, the 3 commands after the "sg" command did not get executed
until after I left that spawned sub-shell.  But I want them executed
by the sub-shell, before the user is free to enter commands to that
sub-shell.

Any way to do it? (And I do not want to put the "sg" command after
the 3 commands, though that "works" after a fashion.)

Running under 4.1 BSD.