Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site wivax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!houxm!vax135!cornell!uw-beaver!tektronix!hplabs!hpda!fortune!amd!decwrl!decvax!wivax!gill From: gill@wivax.UUCP Newsgroups: net.unix Subject: question about sub-shell invoked by sg command Message-ID: <19904@wivax.UUCP> Date: Mon, 10-Sep-84 17:53:06 EDT Article-I.D.: wivax.19904 Posted: Mon Sep 10 17:53:06 1984 Date-Received: Fri, 14-Sep-84 20:48:07 EDT Sender: gill@wivax.UUCP Organization: Wang Institute, Tyngsboro, Ma. 01879 Lines: 28 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.