News for hackers. Stuff that matters.
Re:Shell Script Best Practices, from a decade of scripting t... by irrational on Thursday October 27, 2022 @11:32AM (#33359120)
> while somebody comfortable is shell writes a parallelized one liner

Do you have an example of this? I didn’t even know you could make sql calls in scripts.

Re:Shell Script Best Practices, from a decade of scripting t... by justanotherbody on Thursday October 27, 2022 @11:40AM (#33359244)
mysql, psql etc. let you issue sql from the command line

I don't do much sql in bash scripts but I do keep some wrapper scripts that let me run queries from stdin to databases in my environment

Re:Shell Script Best Practices, from a decade of scripting t... by sargstuff on Friday October 28, 2022 @11:27AM (#33372629)
WASM Gawk wrapper script in a web browser with relevant information about schema grammar / template file would allow for alternate display formats beyond cli text (aka html, latex, "database report output", cvs, etc )
Re:Shell Script Best Practices, from a decade of scripting t... by meken on Thursday October 27, 2022 @04:33PM (#33363642)
I don’t have an example, but this article comes to mind and you may be able to find an example in it

https://adamdrake.com/command-line-tools-can-be-235x-faster-...

Re:Shell Script Best Practices, from a decade of scripting t... by crucialfelix on Thursday October 27, 2022 @06:13PM (#33364739)

  PSQL="psql postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$DATABASE_HOST:$DATABASE_PORT/$POSTGRES_DB -t -P pager=off -c "
  
  OLD="CURRENT_DATE - INTERVAL '5 years'"

  $PSQL "SELECT id from apt WHERE apt.created_on > $OLD order by apt.created_on asc;" | while 
  read -r id; do
    if [[ $id != "" ]]; then
      printf "\n\*\* Do something in the loop with id where newer than \"$OLD\" \*\*\*\n"
      # ...
    fi
  done