first check-in of feisty meow codebase. many things broken still due to recent
[feisty_meow.git] / scripts / files / list_dupes.sh
1 #!/bin/bash
2
3 #header here!
4
5 # lists the files in this (the current) directory that have the same names
6 # as files in the directory passed as the first (and only) parameter.
7
8 list_dir=$1
9 if [ -z "$list_dir" ]; then
10   echo "list_dupes"
11   echo "----------"
12   echo ""
13   echo "This program requires a single parameter, which is a directory name."
14   echo "The files in the current directory will be listed to standard output"
15   echo "if a file in the user-specified directory exists with the same name."
16   exit 42;
17 fi
18
19 for i in *; do
20   if [ -f "$list_dir/$i" ]; then
21     echo "$i"
22   fi
23 done
24