c++ - Creating a customised shell -
i have created customized shell in c++. currently, shell designed infinite while loop started running corresponding executable terminal (i using ubuntu os). shell implements few new commands each stored separate executables in file system. rest of commands user enters directly executed using execve()
wrapper function.
so, essentially, executing user commands using execve() function: customised commands stored separate exectuables , "exec
ed" providing path executable whereas other "standard" unix command directly exec
ed.
instead of running separate executable bash
, want make user use shell executes on terminal. how can that?
i referred following links:
processes , sessions , controlling terminals
however, unable figure out links association between controlling terminal , shell etc. appreciated in regards.
update:
this may sound bit illogical but:
is there way implement user command user can execute current shell?i know there command called chsh... work shell?
first can test shell bash exec yourshell
. replaces bash process shell entirely. (when exit shell, terminal exit/logout it.)
you can run xterm -e yourshell
start xterm shell instead of bash.
if want permanently make default shell:
- add shell list of system shells,
/etc/shells
- change user's login shell
chsh
- log out , in again
Comments
Post a Comment