How can I exclude directories from grep -R?

SOLUTION 1 (combine find and grep) The purpose of this solution is not to deal with grep performance but to show a portable solution : should also work with busybox or GNU version older than 2.5. Use find, for excluding directories foo and bar : Then combine find and the non-recursive use of grep, as a portable solution : SOLUTION 2 (using the –exclude-dir option of grep): … Read more

How can I exclude directories from grep -R?

SOLUTION 1 (combine find and grep) The purpose of this solution is not to deal with grep performance but to show a portable solution : should also work with busybox or GNU version older than 2.5. Use find, for excluding directories foo and bar : Then combine find and the non-recursive use of grep, as a portable solution : SOLUTION 2 (using the –exclude-dir option of grep): … Read more

Display exact matches only with grep

You need a more specific expression. Try grep ” OK$” or grep “[0-9]* OK”. You want to choose a pattern that matches what you want, but won’t match what you don’t want. That pattern will depend upon what your whole file contents might look like. You can also do: grep -w “OK” which will only match a whole word “OK”, … Read more

Connect: Socket operation on non-socket

I see the problem. It’s this line: The == operator has precedence over the = operator. Look at the way you have the parentheses structured on that expression a bit more carefully to see what I mean. sockfd is getting initialize to “0” as a result of being assigned a boolean expression (socket(…) == -1). … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)