Code search

for developers, being able to search for code snippets (e.g. “if [[ "${i}" -eq 1 ]] ; then”) is valuable

i suppose this could be problematic, such as the dbbl quotes in the example which are contained within a phrase search, or the -eq, etc., however perhaps a search keyword could be used (code:blah blah)

1 Like

Noted; what do you use at the moment, if anything, for the same job?

i don’t - i know there’s at least one specialized search engine that does this, but i forgot its name and i think it may be subscription based

if you happen to know of one, i’m all ears

ps: the “free” ones i’m aware of do a terrible job (searchcode, PublicWWW.com, etc.)

1 Like

of course one of the problems is searching for code containing variables - so in my example, [[ "${i}" -eq 1 ]], “i” could be anything, and so could “1”

i surely wouldn’t know the best way to treat this, but i’m thinking a placeholder might be possible, so for instance “$$” could be substituted for anything, so searching for my example might look like “[[ "${$$}" -eq $$ ]]

1 Like