While we may talk often about other pieces of the software development lifecycle, shell scripts don't usually get to take center stage. Let's share some creative little scripts we've come up with over the years!
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<p>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.<p>If enough people are interested, I will publish it somewhere for others to use/adapt/improve.
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.<p>All of them are so trivial but I love them :-D Maybe not so creative tho ;c
Just a backup script for Linux - bummed it together with some googling:<p>Designed for overnight backup, hook up a backup drive in the afternoon one day, and put in safe the next morning.<p>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.