My bash-script is not run in a terminal, but opens a terminal at runtime to ask for user input (sudo password). I would like to tell the user in this terminal what the script is trying to do. First, here is my script:
#!/bin/bash
#This should install: Qt Linguist, lrelease
#for Qt Linguist
dpkg-query -l qt4-dev-tools
if echo $? == 0; then
check1=1
fi
#for lrelease
dpkg-query -l qt4-default
if echo $? == 0; then
check2=1
fi
echo $check1
echo $check2
if [ $check1 = 1 ] && [ $check2 = 1 ];then
gnome-terminal -x sudo apt-get install qt4-dev-tools qt4-default
fi
$SHELL
This opens a terminal with this:
[sudo] password for "username":
But I would like to have:
qt4-dev-tools and qt4-default are missing. Now trying to install.
[sudo] password for "username":
How do I get this when starting the terminal with gnome-terminal -x
?