Questions tagged [file-globs]

20 questions
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
5
votes
1 answer

How to run Ansible with_fileglob in alpabetical order?

I'm trying to build a system that will include tasks from a directory in alphabetical order. Let's say I have the following files in a directory: 01-task.yml 02-task.yml .. 10-task.yml I want ansible to include these tasks in order (01, 02, 03,…
4
votes
2 answers

How to make Ansible with_fileglob include hidden files?

I'm using the following task in my Ansible script to copy all files from a local data folder to the server: - name: copy basic files to folder copy: src: "{{ item }}" dest: ~/data/ mode: 755 owner: "www-data" group: "www-data" …
kramer65
  • 50,427
  • 120
  • 308
  • 488
4
votes
2 answers

How can I handle wildcards on the command line using Perl on Windows?

I though this would be simple, but apparently I can't do: script.pl *.ext in the WinXP command processor. Is there a built-in solution? (i.e. not a CPAN module?)
chris
  • 36,094
  • 53
  • 157
  • 237
2
votes
2 answers

how do i find all files with the same name in all subdirectories

I want to find all the different .gitignore files I have to combine them into one. I tried something like find */**/.gitignore but that came up with nothing. All the files are in sub directories of my current dir, as well as the current…
loosecannon
  • 7,683
  • 3
  • 32
  • 43
2
votes
1 answer

Ansible - Loops with_fileglob - become_user not working -- running action on source machine

Env is: Ansible 1.9.4 or 1.9.2, Linux CentOS 6.5 I have a role build where: $ cat roles/build/defaults/main.yml: --- build_user: confman build_group: confman tools_dir: ~/tools $ cat roles/build/tasks/main.yml - debug: msg="User is = {{ build_user…
AKS
  • 16,482
  • 43
  • 166
  • 258
2
votes
1 answer

How can I use git-rm and file globbing to remove files from certain directories but not subdirectories of those directories?

The scenario I'm trying to remove some files from the entire history of a git repository. They all share a couple of common criteria: They have "settings" in the file name. They may also have various prefixes and suffixes, though. They will be two…
DanielF
  • 53
  • 1
  • 5
1
vote
1 answer

Get file globs from a file and find these files

I have a file called "file.txt" and it contains globs. Contents: *.tex *.pdf *C*.png I need to get these extensions from the file and then find the files containging these globs in the current directory (preferably using find, anything else is fine…
Arzaan Ul
  • 13
  • 4
1
vote
2 answers

How do gulp pattern recursive work **/*

i started to use gulp, i have a little difficulty understand how globs work in gulp. Why do **/* copy all directory structure(how it work)
KarimS
  • 3,812
  • 9
  • 41
  • 64
1
vote
2 answers

Regular expression help: how to ignore every path that isn’t a CSS file

I have a CSS framework submodule in my Git repo that includes a bunch of README, component.json and other files. I don’t want to modify or delete the files because I’d imagine it’d cause problems when updates are pushed to the submodule. Yet…
reneruiz
  • 2,436
  • 2
  • 20
  • 18
0
votes
0 answers

What bash glob pattern matches all files and directories in the current directory except . (current directory) and .. (parent directory)?

What is a bash glob pattern that will match all files and directories in the current directory, except for . (current directory) and .. (parent directory)? e.g., given the following…
Rob Bednark
  • 25,981
  • 23
  • 80
  • 125
0
votes
1 answer

How to glob file name pattern matching in linux using c++ 98

Below is the piece of code, where I am trying to find file with matching pattern from directory path provided. the expectation is to list all the files with pattern matching, for example under "/usr/local" path, the below files are present abc.txt…
AK90
  • 428
  • 1
  • 4
  • 16
0
votes
6 answers

Applying AWK on Set of Files with Same Extension

I want to apply the following "awk" command on files with extension "*.txt" awk '$4 ~ /NM/{ sum += $2 } END{ print sum }' But why this command doesn't work: for i in *.txt do echo awk '$4 ~ /NM/{ sum += $2 } END{ print sum }' $i;…
neversaint
  • 60,904
  • 137
  • 310
  • 477
0
votes
2 answers

ansible looping through the result and finding files

I am using ansible to configire 10-20 linux systems. I have a set of tools that I define in my invetory files with versions, as: tools: - tool: ABC version: 7.8 - tool: XYZ version: 8.32.1 Now, in my playback yml file, I would like to…
wantro
  • 373
  • 1
  • 7
  • 18
0
votes
1 answer

Match minified JavaScript files and html files using globs

I'm trying to delete all files except for my minified JavaScript files, all which have the .min suffix, and all .html files. This is what I have currently: del([ 'build/app/**/*.!(html|min.js)' ]); This ends up deleting all .js files, including…
user3186219
1
2