Free Shell and Python Scripts


License terms
How to download
mail notifier
cd from menu
safe mv command
get programme IDs from BBC schedules
file transfer with SSH
rename photos to date and time
build playlists on Creative Zen mp3 players
put MP3s onto Philips GoGear Vibe mp3 players

back to contents


All the programs on this page contain the following license:

Copyright (C) 2017 Peter Scott - This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <>.

By downloading a script you are accepting the terms of the GNU General Public License for the script.

back to contents


The scripts often contain tabs or other odd characters so they cannot be pasted. You have to do a "save link target as" to a directory on your PATH and make the script executable. If you are using an iPad, or merely want to look at a script you can use the "(see it)" link by the download link.

Alternatively, you can get them or see them on my github page.

back to contents -- mail notifier watches an IMAP account and alerts you with a beep and a very small pop-up when new mail arrives. It takes up no permanent screen space. Here is a snapshot of a corner of my workspace showing the pop-up: message is much simpler than gnubiff and handles lost connections more sensibly. I start it in my .bash_profile and stop it from my .bash_logout.

back to contents

cdm -- cd from menu (see it) displays a menu like this:
menu in xterm
and lets you choose the directory you want by name or by number. (In the screenshot, the reply has been copied -- not typed!) Directories can be omitted from the menu, or added, by setting up a couple of hidden files.

back to contents

sfmv -- safe mv command

sfmv is better than the standard mv command's --no-clobber option because it gives an error message when it doesn't move a requested file.

back to contents

getPids -- get PIDs from BBC schedules

getPids extracts programmme IDs from the BBC schedules using a Python parser to unravel the HTML. getPids has been tested with Python 2.7 and Python 3.5 on Linux, and with Python 3.6 on Windoze 7.

getPids bbcone hd 6 -- would put a week's BBC 1 (HD) TV schedule onto standard output.

The earlier getPids shell script which uses the .json versions of the schedules can be found on my github page.

back to contents

SFTP -- transfer and compare files on remote systems with SSH

SFTP is a convenient front-end to the sftp command; it can be used from the command line to move files about or compare them, or it can be called from cron or from any shell script. SFTP uses the batch mode of sftp but you don't have the hassle of setting up a batch file or reading all the output. Clearly, it is only useful if you have set up password-less logins.

SFTP works with SSH, Open-SSH and Sun's dumbed-down version of Open-SSH.

rsync could, of course, be used instead to do the gets and puts.

back to contents

jpgMv -- rename photos to date and time

jpgMv uses jpgDate to rename a collection of jpg files so they have names like 2005-10-13_00.jpg or 2005-10-13+15-15-46_00.jpg. jpgMv is particularly useful when merging many photos into one directory; it does not overwrite existing files. jpgDate uses exiftool to get the date and time from the JPEGs.

This job can be done nowadays by using exiftool directly. However, jpgMv predates exiftool; jpgDate used to use another method of getting the dates.

back to contents

toZen -- build playlists on Creative Zen mp3 players

I used to love these mp3 players! However, my latest (Style M100) is a huge disappointment. Here is a review.

There are two versions of toZen: one for the newer Zen Style M100 and one for the older Zen Style 100 Both take a directory of MP3s and turn it into a playlist on a mounted Creative Zen mp3 player. They might work unchanged on other mp3 players.

back to contents

toVibe -- put MP3s onto Philips GoGear Vibe mp3 players

toVibe takes a directory of MP3s and puts it onto a mounted Philips GoGear Vibe mp3 player. It might work unchanged on other mp3 players.

These days, I simply keep a copy of the Vibe's Music directory and use rsync to keep the two synchronised.

Valid html5 Peter's Home Page Valid CSS