Skip to content

Instantly share code, notes, and snippets.


Pritish Sehzpaul PritishSehzpaul

Block or report user

Report or block PritishSehzpaul

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
PritishSehzpaul /
Created Jun 14, 2019
A shell script that monitors a directory for new or moved(/renamed) images and executes a program(C program, in my case) that takes the file's location and uploads it to the server. After executing the process keeps on running in the background and watches every new file that comes.
# NOTE: To avoid any word splitting or globbing issues you should always try to use double quotes around the variable name
# Specify any new extensons or filenames over here that you want monitored for changes
FILES_MONITORED=( .+\.jpe?g .+\.png .+\.bmp .+\.JPE?G .+\.PNG .+\.BMP )
# TODO: Update the description
if [[ "$#" -eq 0 ]] || [[ "$#" -eq 1 ]]; then
printf "Upload program's location must be specified. Directory to be monitored must be specified. \n\
[USAGE]: ./ \"directory\" \"path-to-upload-file\"\n\n\
You can’t perform that action at this time.