A hack you could try is the following:
Create a special
bash
.rc file that sources yourbashrc
and runs your script. Lets call it~/foo.rc
$ cat ~/foo.rc #!/bin/sh ~/Desktop/testterm
Create a new "shell" that calls
bash
with~/foo.rc
as its .rc file. Save this script asfake_shell
somewhere in your$PATH
(for example,~/config/bin
) and make it executable:- Now, in your
testterm
script, launchTerminal
usingfake_shell
as the shell.
The script becomes:
#!/bin/sh if [ ! -t 0 ]; # stdin then TIMESTAMP=`date +%Y%m%d%H%M` echo "#!/bin/sh source /boot/common/etc/profile $0" > ~/temp_term$TIMESTAMP.rc echo "#!/bin/sh bash --rcfile ~/temp_term$TIMESTAMP.rc" > ~/config/bin/temp_shell$TIMESTAMP chmod a+x ~/config/bin/temp_shell$TIMESTAMP Terminal temp_shell$TIMESTAMP rm -f ~/config/bin/temp_shell$TIMESTAMP rm -f ~/temp_term$TIMESTAMP.rc fi echo "yay! terminal!" # your script here exit