Skip to content

Instantly share code, notes, and snippets.

@josephworks
Created August 7, 2019 00:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josephworks/817a47bbaf5020297171c37cfef03b30 to your computer and use it in GitHub Desktop.
Save josephworks/817a47bbaf5020297171c37cfef03b30 to your computer and use it in GitHub Desktop.
zenity --info --text="Hello World!"
notify-send "Hello World!"
dialog --title "Delete file" \
--backtitle "Linux Shell Script Tutorial Example" \
--yesno "Are you sure you want to permanently delete \"/tmp/foo.txt\"?" 7 60
# Get exit status
# 0 means user hit [yes] button.
# 1 means user hit [no] button.
# 255 means user hit [Esc] key.
response=$?
case $response in
0) echo "File deleted.";;
1) echo "File not deleted.";;
255) echo "[ESC] key pressed.";;
esac
clear
echo "Scanning TCP ports..."
for p in {1..65535}
do
(echo >/dev/tcp/localhost/$p) >/dev/null 2>&1 && echo "$p open"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment