Before watching this video, I created my own update and upgrade bash script when I started watching your channel. I never used the directory path to update a particular application, so now I will start doing some experiments. Thank you again for another great video!!!!
I've been wanting to make a script for auto update for awhile. This is a huge step in the direction I want to go with my script. Trying to find a way to have it auto reboot if the upgrade command actually upgrades
Just curious, when you ran the grep -q “Ubuntu” your U was capitalized, but is evident that in the ID_LIKE section of the /etc/os-release file it’s there but lowercase. Had you searched for “ubuntu” instead of “Ubuntu” I believe it may have run the way it was intended. If I’m not mistaken? 8:48
Great series but I ran into a snag with this one. I'm running Raspian Bookworm where ID_LIKE=debian - all lower case. Found that grep -iq "Debian" ran the script correctly
Why does a script fail even if the example is followed to the detail... for instance a basic ldd lookup & grab dependencies script for bash in Context of creating a chroot environment
Do all distribution /etc/os-release files consistently contain the parameter ID_LIKE as operating system identifier? I am using Zorin OS, and the os-release file contains: ID=zorin ID_LIKE=ubuntu
I may be missing something but why wouldn't you use if else or case statement? Say your on a Arch system the following if statements will be executed witch is wasting resources.
Great tutorial serie on bash! I have some questions. Wouldn't changing "Debian" to lower case "debian" grep all in os-release file on any system downstream from Debian (i.e Ubuntu, Mint, PopOS etc )work grepping from the ID_LIKE row, thus all deb-depending systems/OS'? I added below to the script but with the first method, I couldn't find what to grep saying flatpak is/isn't installed (maybe you'll come to that later on). If anyone is interested... # If flatpak is installed on this system this should update flatpak apps # add this variable on top: if [ -d $extra_repos ] then # Additional repositories using flatpak echo "Flatpak installed on system" flatpak update fi
9:58 It should work fine if you didn't capitalize the U in Ubuntu right? Since the word ubuntu IS in the os-release for your system. 15:09 That wouldn't have fixed it either since you have a capital D in Debian. By changing it to Pop you are just cheating as far as I'm concerned. :P
I have tried to write the following simple script: #!/bin/bash echo "What is your favorite color?" read color select_color () { echo "What is your favorite color?" read color } x=1 while [ $x -lt 10 ] do if [ "$color" = "red" ] then echo "Nice one......" x=20 elif [ "$color" \= "red" ] then echo "Pick another color......." select_color fi done I cannot get it to run on my linux. I intentionally pick a color other than red, but tt stops at the while loop but never runs the procedure on how to pick another color. I also tried red and same thing, it does not tell me nice one. Could you show me where I am going wrong? Thanks
Qué tal amigo, el condicional 'elif' está de más, con un 'else echo "pick another color"', es suficiente. Después, puedes reducir tu código eliminando la redundacia de volver a preguntar el color favorito usando tu misma función correctamente select_color. Te dejo el código corregido: #!/bin/bash select_color(){ echo "What is your favorite color?" read color } x=1 while [ $x -lt 10 ] do select_color if [ $color = "red" ] then echo "Nice one" x=11 else echo "Pick another color" fi done Sé que es demasiado tarde para responder a tu duda pero quizás pueda ser útil para alguien. Saludos desde Tamaulipas, tierra caliente.