suckless repo: github.com/Edesem/Suckless Python and Bash: 00:00 Advantages of Bash: 1:45 Disadvantages of Bash: 2:35 What Bash is good for: 4:32 Advantages of Python: 5:20 Disadvantages of Python: 7:10 When should you use either?: 8:14
You may never use it again (you first program), but it did two things- 1. it taught me how useful it can be- long term (30+ years!) and it was an excellent learning experience for you. Keep up the fantastic vids. Thank you! As a request/ suggestion for comparison between bash and python: why not write the equivalent of the first program in bash you wrote in python? Maybe even do a live so we can all learn along with you teaching us? Now that would be awesome!
I've been using python in place of some bash scripts lately (for bspwm/rofi scripts). It is nice being able to go back and be able to read things... For instance for your feh/dmenu example you could: ``` from subprocess import getoutput as go WALLPATH="~/pictures/wallpapers" wallpaper = go(f"ls {WALLPATH} | dmenu -i -l 50") if wallpaper != "": go(f"feh --bg-fill {WALLPATH}/{wallpaper}") ```
i made an bash script to run the last saved file and choose the compiler or interpeter based on files language and it gave me strokes like bash syntax is hell
Most Linux tools such as the GNU Core utils (e.g: mkdir, cat) are written in C, having the benefits of it being fast and also portable is honestly pretty nice. C isn't too hard to learn either, although it'll depend on the complexity of the application you're writing.
Writing anything in Bash is a nice exercise, but I'd say it only makes sense if you're really rely on calling programs. Bash is a shell, Bash scripting is for shell scripting, so, you put together stuff in it that you'd be doing in your shell anyways. Like, I do my backups with a Bash script that calls rsync with a specific set of parameters and then rotates old backups using mv and rm. If you need to have many variables (especially arrays, holy cow), and adding together numbers and operations like that, then you go with something else, than shell scripting.
👍Love your video Young Jeti🙏 🤣 You find Python counter intuitive? I need your dictionary, please. I'm not a coder, just a writer learning from you for fun. I thought Python was for web design? But I know nothing of computer script writing. Teach us bash scripting, please.
How about a Python module that implements bash commands? I was thinking of creating one just for fun, but that might actually be useful to other Linux/MacOS users. And maybe implement a batch backed for windows users.