Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'A script to update a hard drive's free space value' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A script to update a hard drive's free space value
Authored by: Cerberus on Sep 02, '05 11:29:21AM

OK I just found out that this script works on any locally mounted device that does not cotnain a space in the name. Anyone have a suggestion for fixing this? This is the only limitation that this sctipt has now...



[ Reply to This | # ]
A script to update a hard drive's free space value
Authored by: Cerberus on Sep 02, '05 11:41:23AM
here is the final code (works much better now) should work under every circumstance:

#!/bin/sh
HD_ROOT_PATH=$(df -l | grep dev | cut -b 54-)
#echo -e "Root Path = "$HD_ROOT_PATH
for i in $HD_ROOT_PATH
do
 if [ -d "$i" ] ; then
  #echo -e "Found a dir @ $i"
   cp /Users/Shared/space.txt "$i"
   rm "$i"/space.txt
 fi
done


[ Reply to This | # ]