linux - get last command line entry from bash in a tcsh shell script -
is there command in tcsh last command entered shell?
the problem last command "tcsh" bash shell switch shell bash tcsh. need sort of inter-shell communication this? try read last line in bash history, work ... think ... maybe sometimes?
here problem:
i make default shell bash. tcsh. not have admin privileges can modify rc files. right have work around placing "bash" or "exec bash" .tcshrc file. prevents me ever using tcsh because if try runs rc file , switches bash.
here idea:
write if statement .cshrc file skip bash command if last command "tcsh".
it should this:
if ( statement here ) bash endif
where "statement here" should false when last command entered shell "tcsh".
if cannot change login shell, try like:
exec bash -l
in ~/.login instead of .cshrc or .tcshrc, tcsh login shell replaced bash login shell.
working around ~/.bash_history or ~/.history content seems awkward if main goal login sessions start out in bash.
Comments
Post a Comment