find . -name *.gradle | blah blah
Instead of finding the root cause, I by-passed it by find . | grep "\.gradle" | blah blah
It just feels great to now connect the dot and know the real reason for the issue.91–100 of 148 posts
find . -name *.gradle | blah blah
Instead of finding the root cause, I by-passed it by find . | grep "\.gradle" | blah blah
It just feels great to now connect the dot and know the real reason for the issue.Quiz; in any directory, full or empty I can run this command $ * and get * What allows me to do this? (the $ is the prompt, not what I typed)
You can't, at least on bash version 5.0.3(1)-release with the default config Ubuntu packages it with. After a lag I get the error `$folder_name$: command not found`
Answer to come.
PS. the response is not important.
As another user mentioned, many POSIX and/or GNU utilities havent aged well. I respect trying to stay portable, but peoples needs change over time and these tools simply havent kept up. Like the other user, I use Fd now instead: https://github.com/sharkdp/fd As well as Silver Searcher: https://github.com/ggreer/the_silver_searcher while Grep performance is pretty good, its also gotten pretty stale with regard to its…
> Smart case: the search is case-insensitive by default. It switches to case-sensitive if the pattern contains an uppercase character*. This is what I want as a default for pretty much any text search.
TL;DR: globbing kicks in before other things unless you turn it off like with single quotes: https://www.tldp.org/LDP/abs/html/globbingref.html Don't forget about globbing when making Bash scripts.
Earlier quoted context omitted.
> Different shells have different globbing mechanisms. Why should all programs tie themselves to the mechanisms of any one particular shell? I don't think my proposal would do that. First, a clarification. When I said "For those from wildcard expansion, it would tell the program what the wildcard was" I meant the shell tells the program the full argument containing the wildcard, not just the wildcard part. E.g., if t…
Right now, programs receive a list of strings as their arguments. What would be a concrete proposal for this X-Y mapping, taking into account that a single Y results in multiple Xes? The calls of executables is done via this system call: int execve(const char * path, char * const argv[], char * const envp[]); How would you modify that system call signature to be able to carry that information? And what about how prog…
Two arrays:
1. An array of all the Ys.
2. An array with one entry for each X. If X came from shell wildcard expansion, this entry is the index into the first array of the Y whose expansion resulted in X. If X did not come from wildcard expansion, this entry is some magic value that cannot be mistaken for an index into the first array.
Pass these arrays in the environment. No need for any kernel or standard library or language runtime modification to support it.
Earlier quoted context omitted.
Right now, programs receive a list of strings as their arguments. What would be a concrete proposal for this X-Y mapping, taking into account that a single Y results in multiple Xes? The calls of executables is done via this system call: int execve(const char * path, char * const argv[], char * const envp[]); How would you modify that system call signature to be able to carry that information? And what about how prog…
> What would be a concrete proposal for this X-Y mapping, taking into account that a single Y results in multiple Xes? Two arrays: 1. An array of all the Ys. 2. An array with one entry for each X. If X came from shell wildcard expansion, this entry is the index into the first array of the Y whose expansion resulted in X. If X did not come from wildcard expansion, this entry is some magic value that cannot be mistaken…
Straight from The UNIX-HATERS Handbook . https://web.mit.edu/~simsong/www/ugh.pdf
find . -name \*.jpg
escape the globEarlier quoted context omitted.
I have written hundreds of shell scripts, several which are hundreds of lines long. When I say they havent aged well, Im speaking from experience. When I use something like: find -name *.jpg I know what it actually does. But what it actually doesnt isnt what it should do. The current behavior returns matched files... unless no files match. Then it returns the literal string "*.jpg". That behavior is usually going to…
You completely ignored my point, which is that none of this behaviour should be surprising or unexpected to anyone who has taken the time to think about how it all works together, and that this flexibility is the inherent way in which the UNIX command line is so powerful. it going to fail if the variable has any spaces Quoting and escaping. I mentioned that already, it's a basic part of the understanding and is not s…