Um hack que você pode tentar é o seguinte:
-
Crie um arquivo
bash.rc especial que origine seubashrce execute seu script. Vamos chamá-lo de~/foo.rc$ cat ~/foo.rc #!/bin/sh ~/Desktop/testterm -
Crie um novo "shell" que chame
bashcom~/foo.rccomo seu arquivo .rc. Salve este script comofake_shellem algum lugar no seu$PATH(por exemplo,~/config/bin) e torne-o executável: - Agora, no seu script
testterm, inicieTerminalusandofake_shellcomo o shell.
O script se torna:
#!/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