Questions tagged [expansion]
428 questions
-1
votes
1 answer
Scons "Dir" command doesn't work?
I've got a sub directory called "myc" containing 2 ".c" files:
$ ls myc
1.c f.c
And my current directory has a SConstruct:
$ cat SConstruct
myc=Dir('myc')
print myc
Program('test2',myc)
Run scons, it prints a bunch of errors:
$ scons
scons:…

Hind Forsum
- 9,717
- 13
- 63
- 119
-1
votes
1 answer
Does a shorthand exist in bash for exit code expansion?
I'm looking for a way to shorten this piece of code to remove the echo $? part.
case 0 in
$( [[ -e /path/to/file/a ]]; echo $?) ) echo a ;;
$( [[ -e /path/to/file/b ]]; echo $?) ) echo b ;;
esac
It feels like bash should have a way…

Phillmac
- 109
- 7
-1
votes
1 answer
Generate All Possible Matches of a Regular Expression
How can I derive all possible matches of a regular expression
For example:
((a,b,c)o(m,v)p,b)
The strings generated from above expression would be:
aomp
bomp
comp
aovp
bovp
covp
b

Nilutpal Borgohain
- 396
- 3
- 9
-2
votes
1 answer
How can Input variables into bash commands to be run inline? Debug bash ctrlZ?
UPDATE: I learned input variables can be accessed with commands like xargs getopts() and using $@ $% and $# as well as !* for the output of last command
To clarify the question when I run a command like
rep="replace" && echo foobar | sed -e…

openInvent
- 1
- 6
-2
votes
1 answer
return double from C function, using macro expansion
Why doesn't the following work when using double (it works using int)
test.c
#include "myFcn.h"
#include
int main () {
printf("L1: %f \n", myGet_L1());
mySet_L1(10.0);
printf("L1: %f \n", myGet_L1());
return…

user3502042
- 1
- 1
-2
votes
1 answer
Variable Expansion inside a for loop
I understand that this is a common problem but I am unable to decipher the answers and suggestion in other questions to make my specific script work.
@echo on
setlocal EnableDelayedExpansion
set directory=%1
set file_list=%2
for /f "tokens=*" %%i…

Adam Howard
- 1
- 1
-2
votes
1 answer
iteration/expansion method solution required
Can anybody help me to Solve the following recurrence using iteration/expansion method?
1.T(n)= T(n-1)+ n,T(0)= 1
The solution should be like this way
T(k)=T(K-1)+K
T(K-1)=T(K-2)+(K-1)
......................

user2759169
- 3
- 4
-4
votes
1 answer
Expand Python regex to list of all possible strings
I am new to Python and not a full time coder as well. I am trying to see if there are any inbuilt regex functions in python that will provide the entire (expanded) list of strings from a python regex.
Example: for the input:
Good…

Deepak
- 163
- 1
- 1
- 8