bitfield/script is a really neat Go project: it tries to emulate shell scripting using Go chaining primitives, so you can run code like this: …
I spotted this script that starts the opendream appication running both a Python uvicorn
server and a npm run start
script and it intrigued me - was it this easy to have a single Bash script run two servers? They were both started in the background with &
, like this: …
I wanted to write a bash script that would start a Datasette server running, run a request against it using curl
, then stop the server again. …
For simonw/museums#32 I wanted to have certain lines in my Bash script ignore any errors: lines that used sqlite-utils
to add columns and configure FTS, but that might fail with an error if the column already existed or FTS had already been configured. …
I wanted to dynamically run the following command against all files in a directory: …
I ran into a tricky problem while working on this issue: the following line was behaving in an unexpected way for me: …
For sqlite-utils issue 250 I needed to locate some test CSV files that start with a UTF-8 BOM. …
I'm working with several huge CSV files - over 5 million rows total - and I ran into a problem: it turned out there were a few lines in those files that imported incorrectly because they were not correctly escaped. …
I used this pattern to pass a SQL query to Datasette's CSV export via curl and output the results, stripping off the first row (the header row) using tail -n +2
. …
TIL this trick, via Pascal Hirsch on Twitter. Enter a line of Bash starting with a #
comment, then run !:q
on the next line to see what that would be with proper Bash escaping applied. …
Given a file (or a process) that produces comma separated values, here's how to split those into separate variables and use them in a bash script. …