Questions tagged [wildcard-expansion]

Wildcard expansion is the process of pattern matching by treating a special wildcard character as a replaceable segment of the pattern.

Wildcard expansion, or globbing in a UNIX context, is a common technique of extracting a set of values that match a simple pattern. The wildcard character stands in for a sequence of potentially variable character that the pattern is not concerned with.

Wildcards typically use the following characters: ?, *, or %.

Depending on the context these can mean different things, but typically ? matches a single character, and * or % match zero or more characters. The specific set wildcard characters accepted vary with the application.

Wildcard expansion is related to regular expressions but should not be confused with them as they are very distinct entities.

51 questions
169
votes
4 answers

What does the double-asterisk (**) wildcard mean?

I've tried the following command but I don't understand the results: ls ** What does ** mean? How should I use it?
Mike Blair
  • 1,821
  • 2
  • 11
  • 11
120
votes
4 answers

Stop shell wildcard character expansion?

Is there any way for a compiled command-line program to tell bash or csh that it does not want any wildcard characters in its parameters expanded? For instance, one might want a shell command like: foo * to simply return the numeric ASCII value of…
hotpaw2
  • 70,107
  • 14
  • 90
  • 153
10
votes
1 answer

C main parameter

I wrote a code which has to display main parameters, but when I compiled it and typed in "*" program shows my file structure. Command in cmd looks like this: program.exe 1 2 3 * #include #include int main(int argc, char const*…
5
votes
2 answers

How do /** and /* differ in terms of directory navigation in Grunt?

This is quite an easy one for you guys, but I can't find a definitive/formal answer to this question. Suppose we are in directory A. Then, "A/* " probably means: Every file and folder directly inside A. "A/** " then may mean: Every file and folder…
batilc
  • 691
  • 1
  • 5
  • 16
5
votes
3 answers

Delaying wildcard expansion in bash, while quoting for special characters

I've written a bash script that needs to do something later. It's called something like this: later mv *.log /somewhere/else However, when called like this *.log is expanded at call time, and the script is called as if I wrote later mv 1.log 2.log…
configurator
  • 40,828
  • 14
  • 81
  • 115
4
votes
2 answers

Stop expanding wildcard symbols in command line arguments to Java

My program has to watch for files which match a mask. The folder name and mask are passed through command line arguments. But the mask is replaced by the first match before I can use it! Double quotes have no effect and other symbols too. I tried…
Konstantin Berkov
  • 1,193
  • 3
  • 14
  • 27
3
votes
1 answer

Snakemake input and output according to a dictionary

I am trying to rename some files in the snakemake pipeline. Let's say I have three files: "FileA.txt", "FileB.txt", "FileC.txt" and I want them renamed according to a dictionary dict = {"A": "0", "B": "1", "C": "2"} to get "RenamedFile0.txt",…
zzabaa
  • 86
  • 5
3
votes
3 answers

how to quickly identify if a rule in Snakemake needs an input function

I'm following the snakemake tutorial on their documentation page and really got stuck on the concept of input functions https://snakemake.readthedocs.io/en/stable/tutorial/advanced.html#step-3-input-functions Basically they define a config.yaml as…
3
votes
5 answers

Prepending some text to each "wildcard" argument in bash

A simple Example: mybin *.txt will expand to mybin a.txt b.txt c.txt But I'm looking for a simple solution to have an expansion to something like: mybin --conf a.txt --conf b.txt --conf c.txt. Is there a built in to do this? What is the simplest way…
powerpete
  • 2,663
  • 2
  • 23
  • 49
3
votes
2 answers

Recursively expand and search pattern of specific subdirectories

I'm looking for an option to search specific subdirectories in python. For instance a directory structure like this: some_files/ common/ 2009/ 2010/ 2011/ ... I only want to search for in the subdirectories that start with…
Juvawa
  • 50
  • 7
3
votes
0 answers

Is there a opensource equivalent to the FileMatcher class in msbuild

I'm building a command line tool which will need to resolve a set of files and folders based on one or more relative paths that contain single (*) wildcards, as well as any-depth-folder (**) wildcards. Ideally I would like a class similar that the…
3
votes
2 answers

How to escape wildcard expansion in a variable in bash?

How do I escape a wildcard expansion in a variable name? CP="lib/*" COMMAND="java $VARIABLES -cp $CP SomeClass" echo $COMMAND Echoing the command always causes wildcard expansion.
Jake
  • 15,007
  • 22
  • 70
  • 86
2
votes
1 answer

Use expand in python to create string with multiple paired variables (snakemake)

Snakemake expand function Hello, I have a list of lists such as : list_ranges=[[0,9],[10,19],[20,29],[30,33]] How can I used expand in Snakemake in order to create 4 arguments such as…
2
votes
3 answers

Manually created snakemake wildcards not used/recognized

I've been trying to manually create snakemake wildcards by importing a tab-delimited file that looks as follows: dataset sample species frr PRJNA493818_GSE120639_SRP162872 SRR7942395_GSM3406786_sAML_Control_1 Homo_sapiens …
manvenk
  • 69
  • 6
2
votes
1 answer

Rule-specific scattergather directive

In the Snakemake documentation on defining scatter gather rules, the scattergather directive is set globally. Is it possible to set the specific value for each rule? For example, rule a splits into 8, and rule b split into 4?
1
2 3 4