#!/bin/bash [ -z $1 ]||[ `expr length $1` -gt 6 ] && { cat << ! 'grepfd': A DOS-floppy searcher (no mounting required) NOTE: only the root directory of the floppy will be searched! Files in subdirectories will not show up... Usage: grepfd ! exit } STR=$(echo $1|tr a-z A-Z) # We'll read the first 16k of the floppy, then skip over the first 9k # of that to avoid tripping on any text in the boot record and the FATs. # Once we blow out the NULs, the VFAT filenames actually become readable. [ -z "`head -c 16k /dev/fd0|tail -c 7k|tr -d [:cntrl:]|grep $STR`" ] \ && echo "Not here." || echo "Found it!"