|
NAMEshell - Creates a temporary interactive shell session in a disposable working directorySYNOPSISshell [-fq] [-d directory]
[shell [...]]
shell [-fkqS] [-s directory]
[shell [...]]
shell -v DESCRIPTIONThe shell utility creates an interactive shell session with a clean environment and with an empty working directory.By specifying a specific shell on the command line, a shell other than the user's login shell may be invoked. If a specific shell is not requested, the SHELL environment variable will be used to infer what shell to start. The basename of the named shell must correspond to a valid login shell and the actual shell that is started will always be taken from the list of valid login shells (by matching the basename of the specified shell, or $SHELL, against the basenames of the allowed login shells). This behaviour may be bypassed by using the -f command line option. Any operands present after the name of the shell will be passed as is to the shell in question. If shell (this utility, not the interactive shell process) receives the USR1 signal, the temporary working directory will not be deleted when the shell session terminates (as if -k had been used from the start). The options are as follows:
ENVIRONMENTshell uses the following environment variables:
shell clears the environment of the interactive shell that it starts, but also sets the following environment variables:
FILES
EXAMPLESStart a new shell in a new temporary directory:$ shell shell: info: Starting /bin/ksh in /tmp/shell-ksh.mJMHFTFE $ exit shell: info: Removing /tmp/shell-ksh.mJMHFTFE Start a new dash shell in a temporary directory: $ shell dash shell: info: Starting /usr/local/bin/dash in /tmp/shell-dash.V7zU6EtZ $ exit shell: info: Removing /tmp/shell-dash.V7zU6EtZ Start a new bash shell in a specific directory: $ shell -d "$HOME/testing" bash shell: info: Starting /usr/local/bin/bash in /home/myself/testing $ exit exit shell: info: Leaving /home/myself/testing in place Start ksh as a login shell and pre-populate the temporary directory with the contents of $HOME/skel. Note, starting the ksh shell as a login shell will in this case make it execute the .profile file copied from $HOME/skel. $ shell -s "$HOME/skel" ksh -l shell: info: Copying /home/myself/skel into /tmp/shell-ksh.ngEwbcpD shell: info: Starting /bin/ksh in /tmp/shell-ksh.ngEwbcpD $ ls -la total 36 drwxr-xr-x 2 myself wheel 512 Apr 15 12:55 . drwxrwxrwt 28 root wheel 512 Apr 21 14:15 .. -rw-r--r-- 1 myself wheel 87 Nov 1 19:14 .Xdefaults -rw-r--r-- 1 myself wheel 771 Feb 9 10:18 .cshrc -rw-r--r-- 1 myself wheel 101 Nov 1 19:14 .cvsrc -rw-r--r-- 1 myself wheel 359 Nov 1 19:14 .login -rw-r--r-- 1 myself wheel 175 Nov 1 19:14 .mailrc -rw-r--r-- 1 myself wheel 215 Feb 9 10:18 .profile -rw-r--r-- 1 myself wheel 108 Apr 15 12:50 .vimrc $ exit shell: info: Removing /tmp/shell-ksh.ngEwbcpD Start a POSIX-ly correct yash shell as another user. $ su testuser -c 'shell yash --posixly-correct' Password: shell: info: Starting /usr/local/bin/yash in /tmp/shell-yash.yrSSGISG $ id uid=1001(testuser) gid=1001(testuser) groups=1001(testuser) $ exit shell: info: Removing /tmp/shell-yash.yrSSGISG SEE ALSOmktemp(1)AUTHORSAndreas Kusalananda Kähäri <andreas.kahari@abc.se>CAVEATSFor Solaris, the list of valid login shells is taken from the “shells(4)” manual on a vanilla Solaris 11.4 system. This is because Solaris lacks “getent shells” and may also lack the /etc/shells file. The /etc/shells file will still be used if it exists.
Visit the GSP FreeBSD Man Page Interface. |