Why can't I expand the parameter types? decltype(std::declval<Ts>()()) is supposed to get the type of the return value from a call to Ts. The ...
Why can't I expand the parameter types? decltype(std::declval<Ts>()()) is supposed to get the type of the return value from a call to Ts. The ...
How to change a command line argument in Bash? explains how to modify input arguments in bash. But in my case, I have a dynamic set of input argument ...
I've been reading through the parameter expansion portion of the GNU bash manual guide and I can't seem to understand what is going on in the final ec ...
This is how my input string looks like: I want to print grabthistext from the INPUT_STRING. I tried echo "${INPUT_STRING##*=}" which prints grabth ...
So for example I have a word: swimming and running. Swimming consist of 8 letters and running of seven, if there is a given fraction, like 3/4 for swi ...
Not critical - but I'm trying to get a deeper understanding of bash scripting and this is driving me crazy! My goal - in a bash script: Define a ...
Given the following string: I want to get the substring function from the string above, in bash. I tried the following: Which gives: However ...
I am trying to get the hostname for a url. I am able to do it with 2 assignments but I want to do it in a single step. I am not able to figure out ...
I am learning shell scripting and came across this line can someone please explain me what this line do? what is the meaning of : here? ...
I am seeing the following code in a bash script: export PATH=/opt/rh/rh-python38/root/usr/local/bin:/opt/rh/rh-python38/root/usr/bin${PATH:+:${PATH}} ...
MWE: I'd like to use parameter expansion in order to get rid of the shellcheck error. The best idea I had was to use echo "${@//?/-}", but this doe ...
It's GNU bash, version 4.4.20(1)-release (x86_64-pc-linux-gnu). I have variable with text in it. For example: now I want to have var2 having the sa ...
I'm trying to use a pretty basic Bash parameter expansion in a script and it's not working; it works fine when I run it in my interactive shell, thoug ...
How can I avoid rest=${burger:1:99999999999999}, is there something that can replace the 9999999999 while still getting the remainder of the string bu ...
On Linux Ubuntu, when you do sudo apt update && sudo apt install perl, it adds the following to the bottom of your ~/.bashrc file (at least, m ...
I'm trying to port some code from bash 5.1 to 4.2.46. One function which tries to strip color codes from a specifically formatted string stopped worki ...
I'm trying to do a string substitution in bash to escape the dots in a version number to ultimately pass to grep. When I run echo ${3.9.1//./\\.} Ex ...
echo ${var1[@]} will run without issues but echo ${1[@]} gives me 'bad substitution.' I am not understanding the difference between these two cmds i ...
i have tried this and i know that because my i variable is *.c so when i try to rename and add the (__swa.c) part it just gets added on the variabl ...
I was surprised that the following is a valid Parameter Expansion. Notice there are unescaped double quotes within double quotes: Can someone pleas ...