Skip to main content

Questions tagged [pattern-matching]

Filter by
Sorted by
Tagged with
5 votes
2 answers
425 views

$ sleep 1234& $ sleep 12345678& $ %sleep\ 1234 bash: fg: sleep 1234: ambiguous job spec $ jobs [1]- Running sleep 1234 & [2]+ Running sleep 12345678 & ...
Dan Jacobson's user avatar
0 votes
2 answers
116 views

I'm trying to understand some subtle behavior of find and its -regex option I am trying to create symbolic links from files entitled slides_.*.pdf in folders that start with L1[0-6]. I tried the ...
mikemtnbikes's user avatar
1 vote
1 answer
85 views

Please look at this pattern replacement in parameter expansion: % zsh -c 'echo ${0/%.jpg/.jpeg}' toto.jpg toto.jpeg Replacement does not occur here: % zsh -c 'echo ${0/%.jpg/.jpeg}' toto.JPG toto.JPG ...
Pierre ALBARÈDE's user avatar
1 vote
1 answer
322 views

I'm new to sed, I have a string lightdm --session-child 14 21 the two numbers can change and I would remove everything after lightdm I tried various way but none worked sed 's/ --session-child*//' ...
klatls's user avatar
  • 53
2 votes
1 answer
159 views

The following code should demonstrate and help with testing inefficient Pattern Matching expressions in a Parameter Substitution for a newline-separated strings var vs. array. The goal is to achieve ...
fozzybear's user avatar
0 votes
4 answers
164 views

I'm trying to replace "}," by "}" from the last line of a file : My /etc/firefox/policies/policies.json file like this because I added the certificate lines using a for loop : $ ...
SebMa's user avatar
  • 2,473
3 votes
1 answer
419 views

This is zmv command to non-recursively replace any number of spaces with a single underscore (thanks to Stéphane Chazelas, who helped me with it): zmv -- '* *' '${f// ##/_}' And here is a command ...
jsx97's user avatar
  • 1,387
2 votes
1 answer
334 views

case "$1","$name" in -py | --python | --python3,*) if [[ "$name" =~ \..+$ ]]; then That doesn't catch stuff, which actually it should, like… USERNAME@HOSTNAME:~$ ...
futurewave's user avatar
-1 votes
5 answers
127 views

I have a file as following: example.txt -1 15 1 0 0 11 -1.0000E+001 1.0000E+001 -1.0000E+001 2 0 0 11 1.0000E+001 1.0000E+001 ...
Honza S.'s user avatar
  • 101
0 votes
1 answer
69 views

Below is my sample test.log file export SQRDIR=/v/orahome/Middleware/Oracle/bin64 export OID=ap0092 export PWD=pass1 export FDPWD=pass1 export AP0085_PWD=pass1 export SVR=AFFPROD export ...
Ashar's user avatar
  • 527
1 vote
3 answers
399 views

I need to print lines between those that contain a "/" in the name. I tried with: awk '/+SOLUTION/ESTIMATES/,/-SOLUTION/ESTIMATES/' $F > fil$F and awk '/+SOLUTION"/"ESTIMATES/,/...
euge1780's user avatar
0 votes
4 answers
123 views

For example, in a large file I might have: This is a /16 text file I'd like to change it to the following: This is a [[[/16]]]] text file Would like to match the exact string /16 Is there a way to ...
Proletariat's user avatar
2 votes
0 answers
103 views

Here is a transcript of commands (and their output) that explains my problem: /tmp/example $ shopt -s cdspell on checkwinsize on cmdhist on complete_fullquote on direxpand ...
Happy Green Kid Naps's user avatar
1 vote
2 answers
73 views

I'd like to know if it's possible to replace both filename.ext and a matched pattern inside its content regarding a pattern founded on the filename itself using sed (and grep also, maybe?). Let me ...
dAllARA's user avatar
  • 33
1 vote
1 answer
4k views

I want to find repeated copies of the config section within the partition dump (binary file), using pattern and 'magic' header. The config section always starts with 202 '0xff' bytes followed by 4 ...
minto's user avatar
  • 595

15 30 50 per page
1
2 3 4 5
12