Vote count:
0
I am making a command-line Gmail client for Linux systems, especially convenient for Arch Linux, considering by default it is only CLI. There is a function in the program that I need for looping back to the main menu, but just before the function is declared, the program just exits back to the main prompt. Here is the code:
function restart () { m } clear echo Working... echo If you are prompted for your sudo password or asked if you want to continue, then you are being echo prompted to install mailutils. This is normal upon first-time use, or echo use on a computer without mailutils installed. echo echo Starting in 5 seconds... sleep 5 echo Examining dependencies... dpkg -l | grep -qw mailutils || sudo apt-get install mailutils echo Starting client... function m () { clear echo Welcome to the Terminal GMail Client, or TGC! echo Please enter your gmail address: read acc name=${acc%@*} echo Welcome, $name! Would you like to read[R] or write[W] emails? read opt if [ $opt=="R" ] || [ $opt=="r" ] then echo Working... sleep 1 clear mail -u $acc -p restart elif [ $opt=="W" ] || [ $opt=="w" ] then clear echo Working... sleep 1 clear echo Enter the subject here: read sub echo Enter the recipients address here: read rec echo Enter carbon copy [CC] here or leave blank for none: read cc echo Enter blind carbon copy [Bcc] here or leave blank for none: read bcc echo Enter the body of the email here: read body echo Sending to $rec... mail -s $sub -c $cc -b $bcc --user=$acc $rec "$body" echo Done! Going to main menu in 2 seconds... sleep 2 restart fi }
Aucun commentaire:
Enregistrer un commentaire