Hi! I'm new, I only started learning Linux 2 days ago. I have a problem with a script on bash. I can't find and fix the error. Can you help me?
Thx Maria
#!/bin/bash
function Ddate()
{
zenity —info \
—title "Date and Time" \
—text "Today is $(date)"
}
function Dcalendar()
{
zenity —calendar \
—title "Calendar"
}
function DReminder()
{
—title "Reminder" \
—entry-text "Birthday/Events..."
}
function DDelete()
{
zenity —entry-text "Empty trash?" > \
—title "DELETE"
if [ —title "DELETE"]
then
rm -rf ~/.local/share/Trash/info/* ~/.local/share/Trash/files/*
}
function Temperature()
{
zenity —entry-text "CPU Temperature" > \
—title "CPU Temperature"
if [ —title "CPU Temperature"]
then
zenity —info —text=$(vcgencmd measure_temp) —title="CPU Temperature"
}
function Screenshot()
{
zenity —entry-text "Screenshot" > \
—title "Press"
if [ —title "Press"]
then
zenity —info —text=$(scrot -d2) —title="Screenshot"
}
while true;
do
choice="$(zenity —height 275 —width 450 \
--list \
--title="Menu" \
--column="Function" —column="Description" \
Date 'Display the actual date and time.' \
Calendar 'Display an interactive calendar.' \
Delete 'Delete trash.' \
Temperature 'CPU Temperature.' \
Screenshot 'Screenshot.' \
Exit 'To quit this script.')"
case $choice in
Date) Ddate;;
Calendar) Dcalendar;;
Delete) rm -rf ~/.local/share/Trash/info/* ~/.local/share/Trash/files/*;;
Temperature) zenity —info —text=$(vcgencmd measure_temp);;
Screenshot) zenity —info —text=$(scrot -d5);;
Exit) break;;
esac
done
Thx Maria
#!/bin/bash
function Ddate()
{
zenity —info \
—title "Date and Time" \
—text "Today is $(date)"
}
function Dcalendar()
{
zenity —calendar \
—title "Calendar"
}
function DReminder()
{
—title "Reminder" \
—entry-text "Birthday/Events..."
}
function DDelete()
{
zenity —entry-text "Empty trash?" > \
—title "DELETE"
if [ —title "DELETE"]
then
rm -rf ~/.local/share/Trash/info/* ~/.local/share/Trash/files/*
}
function Temperature()
{
zenity —entry-text "CPU Temperature" > \
—title "CPU Temperature"
if [ —title "CPU Temperature"]
then
zenity —info —text=$(vcgencmd measure_temp) —title="CPU Temperature"
}
function Screenshot()
{
zenity —entry-text "Screenshot" > \
—title "Press"
if [ —title "Press"]
then
zenity —info —text=$(scrot -d2) —title="Screenshot"
}
while true;
do
choice="$(zenity —height 275 —width 450 \
--list \
--title="Menu" \
--column="Function" —column="Description" \
Date 'Display the actual date and time.' \
Calendar 'Display an interactive calendar.' \
Delete 'Delete trash.' \
Temperature 'CPU Temperature.' \
Screenshot 'Screenshot.' \
Exit 'To quit this script.')"
case $choice in
Date) Ddate;;
Calendar) Dcalendar;;
Delete) rm -rf ~/.local/share/Trash/info/* ~/.local/share/Trash/files/*;;
Temperature) zenity —info —text=$(vcgencmd measure_temp);;
Screenshot) zenity —info —text=$(scrot -d5);;
Exit) break;;
esac
done