# Description: # this script is supposed to provide a way to edit files on a # webdav server using vim. It uses java programs GetDavFile.class and # PutDavFile.class to get and put the files, and it uses vim to # actually edit the file # # Notes: # # By using the junk.txt file as a temporary editing file, there is no # danger of wiping out an existing file on the local system which has # the same name as the webdav resource being requested # # Examples: # vimdav.sh slide/files/documents/alexis_docs/programming/dns-info.xml if [ "$1" = "" ] then (echo "usage: $0 webdavFile ";\ cat $0) | sed -n "/^[ ]*#/p" exit 1; fi sDavFileName=$1 sDavFileBaseName=$(basename $1) #-- for debugging if [ "x" = "x" ] then echo " sDavFileName=$sDavFileName sDavFileBaseName=$sDavFileBaseName" fi rm -f junk.txt java GetDavFile $sDavFileName junk.txt #-- If the requested webdav path is a collection or does not exist at all $-- then the GetDavFile program will not create any file. If this is the case #-- then it is better to exit now if [ -f junk.txt ] then : else exit 1; fi vim junk.txt java PutDavFile junk.txt $sDavFileName #rm -f junk-from-vimdav.tx