174
submitted 20 hours ago by RavenofDespair@lemmy.ml to c/linux@lemmy.ml

made it so i just click file and paste YouTube url

Linux is amazing

#! /usr/bin/bash
echo "Enter a url"
read a

yt-dlp -x $a
you are viewing a single comment's thread
view the rest of the comments
[-] Ephera@lemmy.ml 8 points 15 hours ago* (last edited 15 hours ago)

One thing that will become important pretty quick if you continue making these scripts is that it’s almost always better to wrap your variables in quotes - so it becomes yt-dlp -x “$a”.

Oh man, this reminds me of the joke that any program that's more complex than Hello World has bugs – and folks still don't even agree how to spell "Hello, World!".

Of course, Bash is a particular minefield in this regard...

[-] 18107@aussie.zone 14 points 14 hours ago

I once wrote a 2 line, 10 word script that had 9 bugs in it. I'm not overly proud of that one.

[-] draco_aeneus@mander.xyz 3 points 10 hours ago

I think you might have a career as an accomplished entymologist ahead of you with so much success finding bugs!

this post was submitted on 22 Feb 2026
174 points (98.9% liked)

Linux

62524 readers
841 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 6 years ago
MODERATORS