3
votes
3answers
270 views

Why can't find -regex match a newline?

Why does this fail? touch "$(printf "a\nb")"; find . -regex './.\n.' I also tried these, none of which work: find . -regextype posix-extended -regex '.\n.' find . -regextype posix-awk -regex ...
2
votes
4answers
118 views

Using a generated list of filenames as argument list — with spaces

I'm trying to invoke a script with a list of filenames collected by find. Nothing special, just someting like this: $ myscript `find . -name something.txt` The problem is that some of the pathnames ...
0
votes
1answer
40 views

How to escape spaces while using command's output in command line [duplicate]

I want to perform the following command in command line : $ md5sum $(find . -type f) But this would cause problems when it encounter files with spaces in filenames : md5sum: Kaufmann: No such ...
1
vote
2answers
56 views

double-quoting parameter (representing filename) doesn't help if spaces are contained

When iterating over some filenames double-quoting the parameter does not prevent the filename from being broken: $ mkdir temp $ cd temp/ $ touch a\ b $ for f in $(find .) ; do echo "$f" ; done . ./a ...
3
votes
1answer
73 views

find utility does not recognize bracket notation

I've two files in the current folder: submitWeb.m submit.m the following find does not show the two files: find . -regex .*submit\(Web\)?\.m But the above regex expression works fine in ...
2
votes
2answers
163 views

Use a parameter in a command argument

I run a find command to search files with a name containing perl: find /tmp -name '*perl*' /tmp/perl.pl /tmp/run-perl-stage.pl But when I set the perl name in a variable PARAMETER and run the find ...
19
votes
1answer
688 views

Why doesn't 'find' show this file?

Using find with grep, one can locate files that match a pattern: # find | grep error ./solr-modifiedSolr4/SolrPhpClient/phpdocs/errors.html ./error_log ./includes/classes/error_log However, using ...
1
vote
4answers
167 views

Syntax error in a bash script that calls find

Where is the error in this script please: #!/bin/bash rep="git" files=`find' ${rep} '-type f` for f in ${files} do echo $f done When i run find git -type f alone in the shell, it works!
5
votes
1answer
145 views

find usage - command line vs script

I am seeing different results from the find command between being run manually on the command line vs run in a script. If I run the following on the command line: find . -name '*.txt' ! -name ...
14
votes
2answers
745 views

gnu find and masking the {} for some shells - which?

The man page for gnu find states: -exec command ; [...] The string `{}' is replaced by the current file name being processed everywhere it occurs in the arguments to the command, ...