[TriLUG] Single line scripts

Ken MacKenzie via TriLUG trilug at trilug.org
Mon Sep 5 20:32:52 EDT 2016


Single line scripts.  I will say a script that is effectively used to call
a long single command line, yeah plenty of times.  I am lazy and
forgetful.  The last thing I want to do is type the same thing twice, even
worse is type it then have to remember later how it is laid out and it is
too long ago to up arrow my way to it.  So yeah I make plenty of quick
helpers, say to connect to a device for a vnc over ssh tunnel or what not
sort packages by install size, you name it.

My work's RDP setup uses ts gateway and xfreerdp command line is the only
way though it so that is one I used a lot.  It was a single line till I
turned it into a quick python program in stead but the point remains.

In the end though they are never single line because at the minimum they
contain:

#!/bin/bash (or /bin/python or /bin/perl or bin/whatever)

# why my dumb butt needed to make this

cmd....

Oh I tend to keep them in under my home, not in a place in the path, and I
have stopped using extensions (like .sh or ,py) once in a "production"
usage.  I just get in the habit of ./something or ~/scripts/something when
I need to call them.

Ken


More information about the TriLUG mailing list