Reputation
144,351
Next tag badge:
1014/1000 score
195/200 answers
Badges
21 207 385
Impact
~7.2m people reached

6h
comment How to escape shell metacharacters automatically with `find` command?
I think you're missing the point of the question here. The OP is calling find within find with the argument to the -name of the second find being provided by the first find and transformed by a shell.
6h
revised How to escape shell metacharacters automatically with `find` command?
added 1102 characters in body
6h
revised How to escape shell metacharacters automatically with `find` command?
added 1102 characters in body
6h
revised How to escape shell metacharacters automatically with `find` command?
added 1102 characters in body
9h
answered How to escape shell metacharacters automatically with `find` command?
10h
comment How to escape shell metacharacters automatically with `find` command?
Yes, that's the problem, you only want to escape [, * and ? while printf %q will escape others, like it will change a newline character to $'\n' which for find -name is $'n'.
11h
comment How to escape shell metacharacters automatically with `find` command?
printf '%q' will not escape all characters in the proper way for find's -name. Like for control characters or some non-ascii characters.
1d
revised How can I get relative date based on relative date by linux date command?
added 1 character in body
1d
revised How can I get relative date based on relative date by linux date command?
added 268 characters in body
1d
revised Provide default value if command returns with non-zero exit code
missing quotes
1d
revised How can I get relative date based on relative date by linux date command?
added 122 characters in body
1d
revised How can I get relative date based on relative date by linux date command?
added 112 characters in body
1d
comment How can I get relative date based on relative date by linux date command?
@Dani_l, depends how you look at it. At the time that command outputs a date, the date displayed would be the last monday relative to 10m earlier.
1d
answered How can I get relative date based on relative date by linux date command?
1d
comment How can I get relative date based on relative date by linux date command?
ITYM GNU date instead of linux date. linux is just an OS kernel software. There are several date implementations that can be compiled for Linux, the most common on non-embedded OSes that use Linux as their kernel is the one from the GNU project (part of GNU coreutils).
1d
comment Can sed replace new line characters?
You might want to read Why is using a shell loop to process text considered bad practice? and Security implications of forgetting to quote a variable in bash/POSIX shells and maybe Why is printf better than echo?
1d
comment Can sed replace new line characters?
Note that that syntax is GNU specific, and even with GNU sed, if POSIXLY_CORRECT is in the environment and the input has only one line, there will be no output.
1d
comment Can sed replace new line characters?
Note that that syntax is GNU specific, and even with GNU sed, if POSIXLY_CORRECT is in the environment and the input has only one line, there will be no output.
1d
comment Can sed replace new line characters?
But runs the s command for each input line on a pattern space that is increasingly big.
1d
comment Sort files by highest number in filename
For non-GNU seds, or if POSIXLY_CORRECT is in the environment, you'll need to replace N with $!N.