#!/bin/bash # DO NOT EDIT! (Actually, you can but it will just be overwritten later.) # Must be edited in mkScripts.sh, where it is kept to ease transfer of scripts. # # Use to put a specific WebIT folder into the clipboard. # Sourcing ( . ldc ) will also cd to that folder. fxdr ( ) { if [ "${PWD:2:12}" = '/WebIT/docs/' ] then /bin/ls -og --time-style=+%F\ %T | \ sed -n -e '/^-.......--/s/^[^ ]* *[0-9]* / /p' | \ gawk ' { S = S + $1 sub("....-..-.. ..:..:..","&",$0) print "" $0 "" } END { if (S > 0) { W = match($0,"[12][0-9][0-9[0-9][0-9]-") - 12 printf "%" W "i %i\n", S, NR } }' fixdir.sh | \ sed -e 's/^mode of `//' \ -e "s/' changed from / # /" \ -e '#s/ \([0-7][0-7][0-7][0-7]\) (\([-r][-w][-x][-r][-w][-x][-r][-w][-x]\))/ \1 (\2)/g' \ -e 's/ \([0-7][0-7][0-7][0-7]\) (\([-r][-w][-x][-r][-w][-x][-r][-w][-x]\))/ \2/g' \ -e 's/^\(.*\) -> \(.*\) : done$/\1 -> \2/' \ -e '/ : done$/ { s/ : done$// s/^// s/ -> / -> / }' \ -e 's/$//' # cp -pvurd * "/h/${PWD:3}" /BW/bin/Mirror "$(cygpath -w "${PWD}")" "$(cygpath -w "/h/${PWD:3}")" | \ sed -e 's/\r$//' \ -e '/Mirror v1.43 (C) 2001-2006 by Dominik Jain/d' \ -e '/^ [0-9]* files added, [0-9]* updated$/ { s/$/;/ N s/[\n]// }' \ -e '/^ *$/d' \ -e 's/^ //' \ -e 's/^ /\t/' | \ sed -e '/0 files added, 0 updated; 0 files\/directories deleted/d' \ -e '/[0-9]\+ files added, [0-9]\+ updated; [0-9]\+ files\/directories deleted/ { s/^// s/\([1-9][0-9]*\) \(files added\)/\1 \2/ s/\([1-9][0-9]*\) \(updated\)/\1 \2/ s/\([1-9][0-9]*\) \(files\/directories deleted\)/\1 \2/ s/$// }' \ -e '/^adding / { s/^adding/adding / s/[^\\]*$/&/ s/\\\([A-Z]-[0-9][0-9][0-9]-[12][09][0-9][0-9]\)\\/\\\1\\/ }' \ -e '/^deleting / { s/^deleting/deleting/ s/[^\\]*$/&/ s/\\\([A-Z]-[0-9][0-9][0-9]-[12][09][0-9][0-9]\)\\/\\\1\\/ }' \ -e '/^removing / { s/^removing/removing/ s/[^\\]*$/&/ s/\\\([A-Z]-[0-9][0-9][0-9]-[12][09][0-9][0-9]\)\\/\\\1\\/ }' \ -e '/^updating / { s/^updating/updating/ s/[^\\]*$/&/ s/\\\([A-Z]-[0-9][0-9][0-9]-[12][09][0-9][0-9]\)\\/\\\1\\/ }' chmod -R +rwX "/h/${PWD:3}" fi } #if [ $1 = 1 ] #then # echo "$1" | \ # putclip #fi /BW/lddir clip | \ tee /tmp/ldc.tmp | \ sed -e '1s/^.-...-....$/&/' cd2="$(sed -n -e '2p' /tmp/ldc.tmp)" /bin/rm /tmp/ldc.tmp if [ -f "${cd2}"/Sophia_page_for_????-???.lnk ] then #cygstart -d . --shownoactivate /c/usr/Firefox/firefox.exe $(readshortcut.exe -r Sophia_page_for_????-???.lnk) readshortcut.exe -r "${cd2}"/Sophia_page_for_????-???.lnk | \ sed -e 's/^.*$/&/' fi fxdr if [ -d "${cd2}" ] then cd "${cd2}" # fxdr fi