this post was submitted on 30 Jan 2025
930 points (99.7% liked)

memes

11318 readers
2188 users here now

Community rules

1. Be civilNo trolling, bigotry or other insulting / annoying behaviour

2. No politicsThis is non-politics community. For political memes please go to [email protected]

3. No recent repostsCheck for reposts when posting a meme, you can only repost after 1 month

4. No botsNo bots without the express approval of the mods or the admins

5. No Spam/AdsNo advertisements or spam. This is an instance rule and the only way to live.

A collection of some classic Lemmy memes for your enjoyment

Sister communities

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 39 points 2 days ago (1 children)

I have a great performance optimization for this

What if instead of 1s sleep, we did 0.5s sleep? That’s a 100% improvement.

[–] [email protected] 15 points 2 days ago (3 children)

It's not sleeping for 1 second, $1 is an input parameter in the script

[–] [email protected] 2 points 10 hours ago (1 children)

I took it as meaning sleep for a number of seconds equal to half the value you're sorting. So like f "(( $1 / 2 ))" & or however math works in bash, I always forget.

[–] [email protected] 1 points 8 hours ago (1 children)
[–] [email protected] 1 points 7 hours ago (1 children)
[–] [email protected] 1 points 5 hours ago (1 children)

I bet you also tell people you love regex because you think it makes you look smarter lol

[–] [email protected] 1 points 5 hours ago (1 children)

What if you do love regex? 🥺

[–] [email protected] 1 points 3 hours ago (1 children)

Then you should be cast into the fires of Mt doom where you belong

[–] [email protected] 1 points 48 minutes ago

You wouldn’t say that if you knew regex. 😆

[–] [email protected] 4 points 1 day ago

That sounds expensive

[–] lurch 1 points 1 day ago

the idea isn't wrong tho, as sleep can do fractions. bash cannot though. therefore it would bloat the code a bit to use bc to multiply the parameter by 0.5 or so.