Logo

dev-resources.site

for different kinds of informations.

Notify Yourself After Completing a Long-Running Bash Process

Published at
12/9/2023
Categories
bash
programming
tip
beginners
Author
ngfizzy
Categories
4 categories in total
bash
open
programming
open
tip
open
beginners
open
Author
7 person written this
ngfizzy
open
Notify Yourself After Completing a Long-Running Bash Process

Recently, I worked on projects that take a long time to build. I often stared at the screen, waiting for these to complete, which often resulted in me sleeping off at my desk. Later, I improvised sleeping while listening to some podcasts, but I usually lost valuable time since I couldn't tell when the long-running tasks were done. If only I could get notified if a bash process is done.

Say hello to the "say" command

The say command takes a string of text and reads it out loud. The example below says "brew upgrade done" when you're done upgrading your brew packages.

brew upgrade; say, "brew upgrade done."
Enter fullscreen mode Exit fullscreen mode

Perhaps you often sleep off while listening to one of those monotonic dialogues between Lex Fridman and Elon; you could repeat the alert until you wake up with a little sprinkle of bash.

brew upgrade; for i in {1..1000}; do; say "brew upgrade done"; done;
Enter fullscreen mode Exit fullscreen mode

That would say "brew upgrade done" 1000 times unless you manually stop it(with ctrl+c).

If you don't wake up after 1000 iterations, you should close your laptop for the weekend sleep. Just sleep ๐Ÿ˜†.

โ„น๏ธ The say command comes preinstalled with Macos (I think), but its equivalent should be available on your Linux distro. For example, on my Ubuntu desktop installation, I have spd-say.

Alright, that's it. Have a great weekend, you all.

tip Article's
30 articles in total
Favicon
Ctrl+Alt+Arrow (Right, Left) not working on IntelliJ
Favicon
if locals == globals
Favicon
Version Control Best Practices with Git and GitHub
Favicon
Creating generic types for API (backend) responses
Favicon
Null or Nothing? Unmasking the Mystery of Parameters in Dart
Favicon
List of prompts for successful affiliate marketing
Favicon
My impressions about the book The Clean Coder ๐Ÿงน๐Ÿ“š
Favicon
Why You Should Use GraphQL Playground โฐ
Favicon
Automate WEBP To PNG With A Simple .Bat File
Favicon
In CMS Made Simple, how do you change the theme?
Favicon
A importancia de fazer testes
Favicon
Conditional Styles with CSS :has
Favicon
Do you know that 0.1 + 0.2 is not equal to 0.3?
Favicon
How to save datetime data that is relevant to multiple countries or timeย zones?
Favicon
What I've Learned About Git from Senior Colleagues (Part 1 - git stash)
Favicon
A (somewhat) deep dive into TypeScript constructor intricacies, step-by-step
Favicon
Faster Color picking in Tailwind
Favicon
Evita usar UpperCase o LowerCase C#
Favicon
#DeveloperTipOfTheWeek - Application Security
Favicon
Running out of space on a developer's machine
Favicon
Alert vs confirm in javascript
Favicon
Quick Tip: Counting up to a limit
Favicon
Quick Tip: findFile
Favicon
Time Saving Tip #2 - User Snippets in VSCode
Favicon
Notify Yourself After Completing a Long-Running Bash Process
Favicon
Time Saving Tip #1 - Use Voice Dictation
Favicon
๐Ÿš€ Unveiling the Power of OpenSearch in 202$: A Comprehensive Overview๐Ÿ˜Ž
Favicon
Quick Tip: Checking if a Number is in Range
Favicon
Building a TypeScript Simple Channel (Like Golang)
Favicon
Ubuntu Minimal Install

Featured ones: