Fork me on GitHub
#off-topic
<
2019-01-15
>
yen03:01:24

tableplus is the best postgresql client I’ve used, and I’ve used a few

yen03:01:36

I think it’s macOS-only though

Functional-Tom13:01:45

Question: does anyone know of any projects using Clojure for Formal Verification?

Functional-Tom17:01:26

Awesome. Thank you very much for this!

john17:01:43

No problem!

john15:01:54

Might be helpful

dangercoder17:01:26

I need to grep on a file like this

grep -E "Do foo*" ./foo_2018-01-01.log >> cleansed-log-2018-01-01.log
then i need to do it for 3 months forward.. I have 90 files which I want to get a certain result out of and write to a file. Would one make a shell-script for this?

Chris18:01:49

I think for f in foo_2018-*; do grep blah "$f" > "${f/foo_/cleansed-log}"; done is about what you need

👍 10
Chris18:01:51

So use globbing and a for loop for the iteration, and Bash variable substitution for the filename transformation.

Lennart Buit21:01:35

There is also always find . -name foo_2018-* | xargs grep ...

dangercoder17:01:00

I don't want to type the above command 90 times :')

dangercoder17:01:29

i guess i could use (grep -E "Do foo*" ./foo_2018-01-01.log >> cleansed-log-2018-01-01.log; (grep -E "Do foo*" ./foo_2018-01-01.log >> cleansed-log-2018-01-01.log; )?

timgilbert20:01:39

Note that your regex is probably missing a ., it would match Do fooooo but not Do foobar

5
timgilbert20:01:07

You probably want grep -E "Do foo.*" instead

Lennart Buit21:01:55

while we are on the topic of bash, on MacOS, I have a script that backgrounds some inifinite task (with &), now I can retrieve its PID with $!, but how can I stop it together with its children.

Lennart Buit21:01:15

I tried sending a SIGINT to the parent in the hope that it would kill its children, but to no success

lilactown21:01:34

I think it's the responsibility of the parent process to clean up it's children?

Lennart Buit21:01:45

Yeah would say so too, but that is sadly not happening