|Ned Batchelder : Blog | Code | Text | Site|
Hashtags for commands
» Home : Blog : July 2013
I was working on creating a command today to run Pylint on only the files I had changed:
pylint $(git diff --name-only $(git merge-base HEAD origin/master))
This works pretty well, but I'm not sure it's ready yet. I want to come back to it, and fiddle with it some. Eventually it might go into a bash alias, but for now, I just want to get it back from history.
Rather than remember some detail from the command, I had an idea to make the command findable again. I could give it a hashtag!
pylint $(git diff --name-only $(git merge-base HEAD origin/master)) #lintdiff
The hash is conveniently a comment character for bash, so I can use any hashtag I like, and later come back to it with ^Rlintdiff.
I'm not sure this is really that useful, since I can make a bash alias right off the bat, but this will let me tweak the command until I like it.
tagged: unix» 3 reactions