53,890 questions
0
votes
1
answer
30
views
One line cmd nested FOR loop within FOR loop with delayed variable expansion (not in a batch file!)
I can't recall (and can't work out) if there is a way to have a cmd FOR loop nested within another FOR loop where for each outer FOR loop iteration, the inner FOR loop is iterated.
For example:
FOR /F ...
Advice
0
votes
9
replies
89
views
Shell substitute/show variables from one variable
The task is to show line with variables from one variable (substitute like echo "${!VAR_NAME}" but for multible variables at once)
i e g
l=$(head -1 "$table") #this header can vary
...
4
votes
2
answers
150
views
Error with creating an array of named/predefined string constants in c
For background, I am working to create a version of minesweeper that runs in the terminal to become more familiar with coding bigger projects in c.
I am coding in VScode, to run on a Linux server (...
4
votes
2
answers
197
views
Illegal coercion operation producing inconsistent error/exception behavior depending on scope
Consider this example, a script named test.ps1
function MyTestFunction
{
[CmdletBinding()]
param ()
try
{
[bool]$functionBool= $null
}
catch {throw $_}
Get-...
2
votes
2
answers
112
views
powershell compress-archive verbose output to text file
I have a powershell command that I want to execute and direct the verbose output to a text file.
Compress-Archive -Path $currentLogDir_TempPathString -DestinationPath $currentLogDir_ArchiveFileName -...
1
vote
1
answer
66
views
How to assign int input value as column name in pandas [duplicate]
I need to take an integer input value, assign it to a variable, and then use that variable as a column name to get data from a pandas DataFrame.
Data:
1 10 20 30
2 40 50 60
Steps:
Assign input to ...
1
vote
0
answers
57
views
Why doesn't my GD script with autoloads post its variables?
When I use (Morton.morton_statetest) in another script, It gives me 0, and even if I put a print in Morton script and If I put an print in the other script, it gives me two values different, wit out ...
-2
votes
1
answer
66
views
Timedelta Unit Argument as a Variable [duplicate]
Is it possible to have the units argument for the timedelta function be defined by a variable?
To elaborate, is this possible?
Time_Unit = "days"
Time_Increment = 1
Time2 = Time1 + ...
3
votes
0
answers
155
views
Problem with multi-dimensional session variable in PHP [closed]
I have been trying to build a shopping cart with PHP and MySQL as a learning experiment. I am stuck at passing the ordered items from catalogue to the shopping cart.
After many experiments I figured ...
3
votes
1
answer
155
views
How to convert a string in an array to variable using the array index in PHP [duplicate]
Let's say I have an array_1 containing a string which is a name of another array_2. And now I would like to convert the array index into a variable containing the array_2.
I have the following working ...
-2
votes
2
answers
81
views
If I want a string of text to print if a variable is less than a number how can I do this? [closed]
I'm trying to understand how functions work, I defined my function with length and area parameters.
Here is the problem: I want to write if area is less than a # then print a string of text.
def ...
0
votes
1
answer
80
views
timefold mixed model, how to define CH
How to define CH, if both basic and list variables are included in the model, there is an error as below:
The entity (class com.app.planner.domain.Machine) has both basic and list variables and cannot ...
0
votes
1
answer
158
views
Make array of variables with osclass custom category values
How can I make an array of variables generated using the values passed through a while loop ?
I am using osclass for a uni project and I find no way whatsoever to make a list os usable variables from ...
1
vote
2
answers
125
views
How to read multiple bash variables containing spaces in values with the read builtin?
I'm trying to read 2 lines into two bash variables but those lines contain spaces.
Here is how those two lines are generated :
$ url=https://www.youtube.com/watch?v=c5U4D-Hn5Vg
$ yt-dlp --no-config --...
1
vote
1
answer
96
views
Bash variable string substitution to '*'
I tried to figure out how to replace a string variable to '*'
a="bamtools/*/*bam_metric.summary.tsv"
## not working
echo ${a/*\*/}
I would like to see bam_metric.summary.tsv after ...