Recent Changes

Updates since 1970-01-01 00:00 UTC

(for 2022-10-29_A_bash_helper_for_prefixed_scripts only)

1 | 3 | 7 | 30 | 90 days
List latest change per page only List only major changes
List later changes RSS RSS with pages RSS with pages and diff

2022-10-29

  • 10:16 UTC (new) 2022-10-29 A bash helper for prefixed scripts . . . . mbork Let’s say we have some project we are working on. The project involves a number of shell scripts for various tasks, like versioning, building, testing, deploying etc. It is useful to have these scripts in your $PATH while working on that project. There are several ways to do that. One way is to add the directory containing them to $PATH, but only for the time we’re working on the project. Another is to use things like npm run and the scripts property of package.json (and I’m fairly sure many other languages feature similar facilities). Recently, I found yet another one, which is pretty useful and extremely cool at the same time. I prefixed all the scripts with the project’s (abbreviated) name, say dw-​. So, assume I have scripts like dw-version.sh, dw-build.sh, dw-test.sh etc. Now I can permanently add the directory containing them to my $PATH, since I (kind of) namespaced them and they won’t get mixed with any other project’s scripts (nor general use utilities). The only trouble that’s left is that typing dw- each time is a bit tedious. Well, Bash to the rescue.

More...

Filters