Sorin

Romania

itguy.ro

Age: 35

Mar
22
comment How to check what shell is running?
+1 for a creative solution
Mar
14
answered Conditionally match a word using sed
Mar
10
awarded Supporter
Mar
6
comment Custom tab completion in python argparse
@Denis Otkidach: Did you actually read the answer ?
Mar
6
answered Custom tab completion in python argparse
Mar
6
comment Replace a string in all files - Unix
I don't know if I need to laugh or to cry.` sorin@sorin:~/tmp$ find -name "./tc/*.c" find: warning: Unix filenames usually don't contain slashes (though pathnames do). That means that '-name ./tc/*.c'' will probably evaluate to false all the time on this system. You might find the '-wholename' test more useful, or perhaps '-samefile'. Alternatively, if you are using GNU grep, you could use 'find ... -print0 | grep -FzZ ./tc/*.c''.`
Mar
6
comment Single dimensional array from a while loop in php
I think you mean $xyz[] = $row2['whatever_your_column_name_is'];
Mar
6
comment Shell Script to find pattern exists or not
grep was designed for checking the existence of a pattern in a file, hence the result code. It's one of the few commands that has non-zero exit codes reporting something else than errors. Instead, you chose to span a shell and to do integer comparison which to say the least it's cumbersome. not to mention the fact that grep -c reads and processes the entire file, while -q exits at the first found match.
Mar
5
awarded Caucus
Mar
5
comment Shell Script to find pattern exists or not
-1 for even considering -c
Mar
5
comment Replace a string in all files - Unix
-1 for using ls to handle file names. I would add another one for missing the obvious "simpler" solution sed -i ... td/*.c (with a globstar added if needed). And another one for using directory names in find's -name option (see: linux.about.com/od/commands/l/blcmdl1_find.htm)... How did this get 4 votes ?
Mar
5
comment how do I know if a bash script is running with nohup
actually, you are doing the exact same thing tty -s checks if stdout is a terminal (see: ss64.com/bash/tty.html) and -t 1 is the same (see: gnu.org/software/bash/manual/…)
Mar
4
comment Trying to get the directory name from a users choice array
I don't understand your question, the first line of this answer gives you the solution
Mar
1
comment Determine the delay in mirroring ( mirroring is done by using rsync and rsh )
You didn't get the getaddrinfo because it's not the one consuming most of the time. select sounds about right for rsync.
Feb
28
answered how do I know if a bash script is running with nohup
Feb
28
revised Determine the delay in mirroring ( mirroring is done by using rsync and rsh )
added 564 characters in body
Feb
28
comment Determine the delay in mirroring ( mirroring is done by using rsync and rsh )
let us continue this discussion in chat
Feb
28
comment Determine the delay in mirroring ( mirroring is done by using rsync and rsh )
Without a sample of what are you trying to do, I can not advise you further. strace -c ls | awk '{print $2}' | tail -1 doesn't "work" because strace uses STDERR ... if you want it to work you should redirect STDERR to STDOUT: strace -c ls 2>&1 | awk '{print $2}' | tail -1
Feb
28
comment Determine the delay in mirroring ( mirroring is done by using rsync and rsh )
Modifying rsh.c is not necessary from my point of view, strace should give you all the information you need. Anyway, I can't help you with the code.
Feb
28
answered Trying to get the directory name from a users choice array
1 2 3 4 5