In the release for Bash-5.0 it is mentioned that they added
BASH_ARGV0: a new variable that expands to $0 and sets $0 on assignment.
What is the purpose of this? When is this an improvement over just using $0?
I don't expect it to be modifiable. That is, I don't expect it to enable something like ARGS=("${ARGS[@]}"), but only to simplify something like myarray=("${ARGS[@]/--unneeded-argument/}").
@JeffSchaller well, I undupped it. From the comments and the fact that they accepted Stephen's answer that didn't really go into removing values from @, I got the impression that they were really just looking for an alternate name to @, and the removing items was just an example
should have asked if they were used to Perl... it has use English, which makes alternate names available for some of the symbol variables, like @ARG for @_ (the list of arguments to a function)
@JeffSchaller that was a bit of an odd question, though. I really wasn't sure what it was they were after. But then, if one isn't too familiar with the shell, quirks like $@ can seem odd.
@JeffSchaller I could possibly read it as if they used to be able to cd /Downloads. They certainly sound surprised that they can't do it now after the update.
But then again, they do show the contents of /root.
@Kusalananda is "Associative arrays are created using ... declare -A name." still in there? I'd like to remove the trailing period, since it looks syntactical, and isn't present in the previous examples
@JeffSchaller as a dupe of that, perhaps. But marking it as a dupe of that Kali question was just uncalled for in that case, IMO. (I can't know who marked that since it just lists everyone without specifying what close reason they voted for)
I'm interested in wrapping a command such that it only runs at most once every X duration; essentially, the same functionality as the lodash throttle function. I'd basically like to be able to run this:
throttle 60 -- check-something
another-command
throttle 60 -- check-something
another-command...
@JeffSchaller It's burned me before. I have written scripts using associative arrays that wont work for my coworkers because they refuse to update bash :p
Oh hey, @RuiFRibeiro, since I've called you out publicly about your tone a couple of times, I wanted to also publicly thank you for a wonderfully helpful and civil comment exchange here.
the line of sanity always needs pushing... finding documentation for a certain vendor that says to create a systemd service file, then run: systemctl daemon-reload, then run systemctl enable [unit service file].service, and then REBOOT THE COMPUTER
@Jesse_b I've seen this before. They don't actually think they're getting a new shell when they run sudo su -. They think it's the same shell and they've just "switched users".
Some called me obtuse, I feel offended but sometimes I find it is not completely wrong By the way https://unix.stackexchange.com/questions/502189/does-this-laptop-with-lubuntu-18-04-use-a-bootloader