Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
1 vote
2 answers
160 views

I am trying to organize a large group of files for use with another program that can run them archived but only if they are named for example "My Document.7z" and not "My Document.txt....
Wolf_'s user avatar
  • 33
3 votes
2 answers
150 views

Hello Amazing People, I have been trying to achieve a goal of matching an extended glob pattern to a string array (file paths) and getting the list of file which matches to the pattern. Below is the ...
Sagar Jain's user avatar
0 votes
1 answer
105 views

I have script se.sh: #!/bin/bash files="1ドル" shopt -s nullglob shopt -s extglob for f in a/path/to/all/files/${files}; do echo "file process:${f}" done shopt -u nullglob shopt -...
gfan's user avatar
  • 1,109
2 votes
2 answers
111 views

Bash 3.2.57 (on macOS 12.6.8) extended glob pattern negation is not working in parameter substitution: $ shopt -s extglob $ s=abc $ echo ${s##!(a)*} I expected the last command to output abc, but it ...
0 votes
1 answer
93 views

Below files are present in current directory. -rw-r--r-- 1 kazama kazama 0 Feb 16 08:50 london_july_2001_001.jpeg -rw-r--r-- 1 kazama kazama 0 Feb 16 08:50 london_march_2004_002.png -rw-r--r-- 1 ...
Sking's user avatar
  • 3
3 votes
1 answer
7k views

lets say I have a my_dirs/ directory, insdie that directory I have several parallel subdirectories which has several files and I want to delete all of them except the ones that have the substring '....
Valentin's user avatar
  • 451
2 votes
1 answer
202 views

I am trying to list some selective files but want to exclude atop_20210428, but the following extended glob atop_20210@(3|4)*[0-4]*!(8)* does not exclude the file atop_20210428, what is the correction ...
vjwilson's user avatar
  • 921
1 vote
1 answer
392 views

This works shopt -s extglob find /usr/!(^*|@*) -maxdepth 0 -cmin +1 -exec echo {} \; shopt -u extglob This returns an error syntax error near unexpected token `(' function test { shopt -s extglob ...
B H's user avatar
  • 131
1 vote
1 answer
93 views

In my interactive shell I can store a pattern in a variable $ targets="?(pcm52|pcm61)" $ ls -l config/devdesc.$targets -rw-r--r-- 1 kfa kfa 113 Dec 16 13:43 config/devdesc.pcm52 -rw-r--r-- 1 ...
Kjeld Flarup's user avatar
  • 2,661
0 votes
1 answer
106 views

I knew I can do arr=(*.log) to get all *.log files into arr. But when I try extglob with more complex pattern it seems fail: $ shopt -s nullglob extglob; x=([a-z][0-9].+([0-9]).*.gz); echo "${x}&...
Wang's user avatar
  • 8,446
0 votes
1 answer
337 views

In a GitHub action, I'd like to remove the old bundle files from the FTP server after deploying the new bundle. To achieve this, I thought to Deploy new bundle Parse the hashes of (main-\*.js, ...
1 vote
0 answers
124 views

Here is my script: #!/bin/bash x="aabcaa" y=${x##*(a)} echo $y It outputs aabcaa when I expect bcaa. When I try the same commands on a bash shell (got with bash command from zsh shell), ...
16 votes
3 answers
3k views

Using the pattern match !("file1") does not work within a bash script but will work on the command line. For example: ls !("file1"|"file2") This will list all files in directory except file1 and ...
Ogden's user avatar
  • 171
0 votes
1 answer
78 views

There are three files in a directory: ab2 ab23 ab3 When I execute: ls ab+(2|3) It displays: ab2 ab23 ab3 instead of ab2 and ab3 only. Any ideas why it is like that? Is it a bug?
szawel's user avatar
  • 3
-1 votes
1 answer
290 views

I'm trying to copy a directories contents without one file. The problem i'm having is that the file is a few folders nested and the extglob operator fails to match. Assume the following folder ...
Jarvis's user avatar
  • 310

15 30 50 per page
1
2

AltStyle によって変換されたページ (->オリジナル) /