[TriLUG] Single line scripts

Steve Litt via TriLUG trilug at trilug.org
Mon Sep 5 17:07:41 EDT 2016


On Mon, 05 Sep 2016 15:34:52 -0400
Grawburg via TriLUG <trilug at trilug.org> wrote:

> I have long commands I enter in a terminal, such as starting
> connecting to a Raspberry Pi located several floors away with ssh, or
> setting up a connection to my NAS (rather than having a line
> in /etc/fstab). I can simply have a text file saved and do a copy and
> paste into terminal each time I need it, but I'd like to turn it into
> a what I would have called a .bat file decades ago. 

The term you're looking for is "shellscript", and although they
can have any file extension, but ".sh" is idiomatic.


> Is this something
> I should learn to to do in bash? 

Yes. Definitely. Running a shellscript is far superior to opening a file
and pasting a command onto the command line.

> I don't need multiple lines, there
> is no extra coding, just a single line.

If these shellscripts will be simple, this becomes an excellent use
case for UMENU2:

http://troubleshooters.com/projects/umenu2/
 
SteveT

Steve Litt 
September 2016 featured book: Twenty Eight Tales of Troubleshooting
http://www.troubleshooters.com/28




More information about the TriLUG mailing list