

Ask HN: What does your favorite custom shell script do? - mikemajzoub

While we may talk often about other pieces of the software development lifecycle, shell scripts don&#x27;t usually get to take center stage. Let&#x27;s share some creative little scripts we&#x27;ve come up with over the years!
======
eukaryote2
One I've had for years is bookmarks. It's actually a bash shell function. You
can bookmark a file or a directory. $ bma filename $ bma dir

when you type bm, it lists the bookmarks. Select a directory, and it cd's to
it. Select a file, and it opens it in vi. Bookmarks can be grouped and sub-
grouped and shared with many users on the same linux/unix box.

If enough people are interested, I will publish it somewhere for others to
use/adapt/improve.

~~~
jarboot
I'd love to see this!

------
auganov
A file context menu option in Windows Explorer that calls a batch script that
passes names of the file(s) to a bash script that SCPs them onto my server.
Another context menu option in WE that opens a new cygwin bash session at the
given path. Last one is a bash function "wemacs" that takes a cygwin
path/file, translates it to a windows path and opens the path in Windows-
native Emacs.

All of them are so trivial but I love them :-D Maybe not so creative tho ;c

------
LarryMade2
Just a backup script for Linux - bummed it together with some googling:

Designed for overnight backup, hook up a backup drive in the afternoon one
day, and put in safe the next morning.

Script mounts and verifies existence of a backup external hdd; creates a
backup tar on the drive; deletes all but the last five recent backup archives;
then unmounts drive for removal next morning.

------
blubbers
i wrote a script in bash, then perl that fetches EOD quotes, change ytd, etc
etc, and stores them as JSON, then parses them on demand.

