Your example proves that not using arrays is worse. That loop will only run once and just print every element on one line. The array equivalent works as expected , _isn't_ affected by IFS, and can handle spaces in individual elements
f='a b c d e'
for i in "$f"; do echo $i; done
# prints a b c d e
f="a b c 'd e'"
for i in $f; do echo $i; done
# prints
# a
# b
# c
# 'd
# e'
f=(a b c 'd e')
for i in "${f[@]}"; do echo $i; done
# prints
# a
# b
# c
# d e
You could always construct an example to how a specific behaviour. The problem in the example here is that you can't set environment variables to a list of arguments, you can only set it to text strings.
Normally on the command line data comes from somewhere. It might be some sort of text processing such as a grep or sed command. And that works just fine:
for i in "$(grep stuff)"; do
works just fine and as expected. But when you have to slice and dice that output to fit bash arrays, you not only have to take IFS into account, it quickly gets way harder to read than doing it the normal way. That's why I generally tend to view the use of arrays as a warning. Maybe you are doing something unnecessarily complicated, maybe you are writing Python in bash.
Your specific example should be written as the easiest form:
`su` predates `sudo` by a decade doesn’t offer the fine-grained control `sudo` has. With `su` if you have the root password, you can do anything you want as root. With `sudo` admins can configure what commands users are allowed to run as root and could specifically block `sudo bash` from running.
You don't need to completely change if you don't want to. setuptools will most likely continue supporting the old way for a long time since there is so much Python code out there that will probably never update to the new standards.
Also, it takes only minimal changes to bring a setuptools-based project into the present. You just need to add a `pyproject.toml` file to your project with the following:
Then when it's time to distribute the project, instead of `setup.py sdist` and `setup.py bdist_wheel`, you can just use the official build[1] tool like so:
pyproject-build --sdist --wheel
And that's all there is to it. Once that's in place and if you're feeling frisky, you can try taking advantage of new setuptools features that can allow you to eliminate `setup.py` entirely and specify everything in `setup.cfg`[2] so that all your project's information is static and no code needs to be run when installing it, assuming your project doesn't contain any compiled code.
As and added benefit, by putting pyproject.toml in your projects now, if you wanted to switch over to another tool like poetry or flit later on, the act of packaging the project doesn't have to change as long as you update the pyproject.toml file with the new build system. The same `pyproject-build` command will work for all three systems.
Note that with the recent versions of `build` it's recommended not to pass `--sdist --wheel`. Just do:
python -m build
With this invocation it'll produce an sdist, and then it'll build a wheel from that tarball, not from your Git checkout which is much closer to what pip does in the wild. When building both artifacts from a Git checkout, it's possible to mess up packaging making it impossible to produce a wheel out of an sdist (which is necessary in many places, including installs from tarballs that pip tries to build wheels from and downstream packaging in different OS ecosystems).
Actually Chrome on Linux doesn't use hardware acceleration for video playback and never did, while the most recent Firefox almost does, if one turns a couple of experimental knobs.
Off topic but I just tried to move from MacOS to Pop!_OS and this is the main reason that I can't migrate now. No GPU Accel on Chrome means scrolling is horrid on QHD/higher resolution (besides YouTube being pretty much useless). Firefox is fine but there's no user profile modes to separate between my various profiles. With so much work being done on browsers, it feels weird that Linux is so behind on this. And Chrome seem to not want to implement the GPU acceleration at all. I guess I'll pay the Apple tax for the foreseeable future.
Well, I am not sure I understand what you mean. There are two distinct GPU Acceleration technologies at work here:
- for videos
- for website rendering
AFAIK the video acceleration part is the big problem as the issue was ignored for many years by the browser vendors. For rendering websites most browser should do just fine, some hardware-browser combinations might be exceptions though.
I also wonder what you mean by Firefox has no user profiles, because Firefox has a profile concept too. Be default it doesn't ask you, but when you start it with `firefox --ProfileManager` you will see what I mean. I don't like messing with the Profile Manager every time, so I just have different Icons for starting different Profiles (e.g. Music --> Spotify, Movies --> Amazon & Netflix, etc.).
Currently there are just two websites for which I have to use Chromium:
1. Geforce Now, officially Linux is not supported, but with Chromium it does work when you change your user-agent
2. Binance, for whatever reason their login capture doesn't work with Firefox
OK so I'm not sure what's happening with the scrolling. But it's definitely smoother on Firefox than on Chrome. I'm sure it's not my hardware/OS combination (1060 + PopOS w/ Nvidia blobs).
On the profiles part: I am aware of the --ProfileManager option. But the icon is new to me. Should be worth trying. Thanks. Work uses G Suite so I don't know how Meet + some other tools react with Firefox.
I prefer using Firefox anyway, but if you want to dig deeper regarding your Chrome GPU acceleration you might find the following pages valuable:
chrome://gpu/ -- here you can see the current status of your GPU Acceleration
chrome://flags/ -- search for 'GPU' or 'accel'. This is the place where you can override some related settings, but be aware, that this might break your browser, so better backup your browser configuration directory before changing anything ;-)
Firefox added hardware acceleration support very recently, June for Wayland and end of August for X11, and needs to be manually enabled plus YouTube needs to be told to use a supported codec. It's also possible your distro isn't supporting it yet.