General TC > Programming & Scripting - Unofficial
Script to download extensions+dependencies on other Linux distros
Rich:
Hi GNUser
I already incorporated the integer and sudo changes, as well as a usage message, extremely basic command
line validation, and some other cleanup.
I will roll in your UID addition. Environmental variables use all uppercase, so I'll probably rename that.
I will include your moving chown to a function so I use it in a few other places.
Although the use_sudo is not necessary, I'll include it because it's probably good form.
Rich:
Hi GNUser
Here are new copies of both scripts. I added your changes, more error checking, and a help (-h) screen.
I did some cleanup on the ShowErrors.sh script too.
[EDIT]: Attachments removed. A link to the current version is in the first post of this thread. Rich
gadget42:
re: my earlier semi-related(or not) posts...sigh...one more...but Rob Pike! ftw!
https://rachelbythebay.com/w/2022/04/07/empty/
sharing is caring
20220408-0535am-modified: added "this is not the first mention of Rob Pike on the forum"(go figure...said tongue-in-cheek...lol)
GNUser:
Hi, Rich. Looks great and works perfectly.
The only fault I can find is purely cosmetic: There are stray -es in Log.txt:
Forum error. See attached.
P.S. The issue is that the behavior of echo's options is notoriously inconsistent across different implementations. printf is a lot more consistent. Solution is in the attachment.
Rich:
Hi GNUser
--- Quote from: GNUser on April 08, 2022, 09:09:53 AM --- ... The only fault I can find is purely cosmetic: There are stray -es in Log.txt: ...
--- End quote ---
Unfortunately, it's not just cosmetic. The ShowErrors.sh script is basically a state machine and uses the blank
lines as a reset mechanism.
I used echo because it's simple. It didn't occur to me that some versions didn't support escape sequences. I also used
it because it's likely available on all systems. I don't know if that's true of printf.
While it is a good fix, I do want to keep the number of commands required as small and simple as possible just to
minimize the odds of weird stuff like this happening.
Since I was just looking for some extra linefeeds, I'll add a few extra echos in place of the \n sequences.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version