{ "uuid": [ { "value": "33bea7ca-ccf4-4865-bc17-314ce54b6988" } ], "langcode": [ { "value": "en" } ], "type": [ { "target_id": "daily_email", "target_type": "node_type", "target_uuid": "8bde1f2f-eef9-4f2d-ae9c-96921f8193d7" } ], "revision_timestamp": [ { "value": "2025-05-11T09:00:08+00:00" } ], "revision_uid": [ { "target_type": "user", "target_uuid": "b8966985-d4b2-42a7-a319-2e94ccfbb849" } ], "revision_log": [], "status": [ { "value": true } ], "uid": [ { "target_type": "user", "target_uuid": "b8966985-d4b2-42a7-a319-2e94ccfbb849" } ], "title": [ { "value": "Bash scripting for fun (and profit?)" } ], "created": [ { "value": "2024-08-19T00:00:00+00:00" } ], "changed": [ { "value": "2025-05-11T09:00:08+00:00" } ], "promote": [ { "value": false } ], "sticky": [ { "value": false } ], "default_langcode": [ { "value": true } ], "revision_translation_affected": [ { "value": true } ], "path": [ { "alias": "\/daily\/2024\/08\/19\/bash-scripting-for-fun-and-profit", "langcode": "en" } ], "body": [ { "value": "\n

As well as PHP, JavaScript, HTML, CSS, etc, I write a lot of Bash scripts.<\/p>\n\n

From project-specific run files<\/a> to CI pipelines, Dockerfiles and deployment scripts, Bash is used a lot in the ops side of software development.<\/p>\n\n

Today, though, I wrote a small Bash script for my personal laptop<\/a>.<\/p>\n\n

I store an archive of video files on an external hard drive of conference talks, courses, tutorials or live streams that I want to keep or rewatch, and found that I've sometimes downloaded the same videos more than once, with the same files on my laptop and hard drive.<\/p>\n\n

A few days ago, I was watching a video that I thought I'd save, but wasn't sure if I already had, so this script dumps the contents of my hard drive into a JSON file that I can easily browse or search through to see if I already have a video archived.<\/p>\n\n

The script is fairly simple and uses tree<\/code> and jq<\/code> to display and format the data before saving it to a file on my laptop.<\/p>\n\n

When I need to update the file, I plug in the hard drive and run it again.<\/p>\n\n

A simple problem, and not something related to a particular project, but something I was able to solve with a Bash script.<\/p>\n\n ", "format": "full_html", "processed": "\n

As well as PHP, JavaScript, HTML, CSS, etc, I write a lot of Bash scripts.<\/p>\n\n

From project-specific run files<\/a> to CI pipelines, Dockerfiles and deployment scripts, Bash is used a lot in the ops side of software development.<\/p>\n\n

Today, though, I wrote a small Bash script for my personal laptop<\/a>.<\/p>\n\n

I store an archive of video files on an external hard drive of conference talks, courses, tutorials or live streams that I want to keep or rewatch, and found that I've sometimes downloaded the same videos more than once, with the same files on my laptop and hard drive.<\/p>\n\n

A few days ago, I was watching a video that I thought I'd save, but wasn't sure if I already had, so this script dumps the contents of my hard drive into a JSON file that I can easily browse or search through to see if I already have a video archived.<\/p>\n\n

The script is fairly simple and uses tree<\/code> and jq<\/code> to display and format the data before saving it to a file on my laptop.<\/p>\n\n

When I need to update the file, I plug in the hard drive and run it again.<\/p>\n\n

A simple problem, and not something related to a particular project, but something I was able to solve with a Bash script.<\/p>\n\n ", "summary": null } ], "feeds_item": [ { "imported": "1970-01-01T00:33:45+00:00", "guid": null, "hash": "d8356a3f3c57c5eb0702b65d33904107", "target_type": "feeds_feed", "target_uuid": "90c85284-7ca8-4074-9178-97ff8384fe76" } ] }