first check-in of feisty meow codebase. many things broken still due to recent
[feisty_meow.git] / scripts / files / dos_perm.sh
1 #!/bin/bash
2 # dos_perm: whacks a directory with the most open set of permissions
3 # available to the dos/windoze attrib command.
4
5 folder="$1"; shift
6
7 if [ -z "$folder" ]; then
8   echo "This program requires a folder to set the permissions on.  That folder and all"
9   echo "files in it will be opened up to as full a permission level as DOS's attrib"
10   echo "command is capable of."
11   exit 3
12 fi
13
14 folder="${folder}/"  # add a slash to ensure there's at least one after drive letters.
15
16 dos_folder=$(echo $folder | sed -e 's/\/\([a-zA-Z]\)\/\(.*\)/\1:\/\2/' | sed -e 's/\//\\\\/g')
17 #echo dos folder is $dos_folder
18
19 attrib -r -s -h //s //d "$dos_folder\\*"
20