Index: ossp-pkg/due/.due/due.calc.sh RCS File: /v/ossp/cvs/ossp-pkg/due/.due/due.calc.sh,v co -q -kk -p'1.1' '/v/ossp/cvs/ossp-pkg/due/.due/due.calc.sh,v' | diff -u /dev/null - -L'ossp-pkg/due/.due/due.calc.sh' 2>/dev/null --- ossp-pkg/due/.due/due.calc.sh +++ - 2025-04-11 21:57:11.610201954 +0200 @@ -0,0 +1,41 @@ +## +## OSSP due - Dynamic User Environment +## Copyright (c) 1994-2004 Ralf S. Engelschall +## Copyright (c) 1994-2004 The OSSP Project +## +## This file is part of OSSP due, a dynamic user environment +## which can found at http://www.ossp.org/pkg/tool/due/ +## +## Permission to use, copy, modify, and distribute this software for +## any purpose with or without fee is hereby granted, provided that +## the above copyright notice and this permission notice appear in all +## copies. +## +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## +## due.calc.sh: DUE module for command line calculations +## + +# define {bin,oct,dec,hex}2{bin,oct,dec,hex} commands +_bases="bin:02 oct:08 dec:10 hex:16" +for _i in $_bases; do + for _o in $_bases; do + [ ".$_i" = ".$_o" ] && continue + eval "${_i/:*/}2${_o/:*/} () { + echo \"obase=${_o/*:/}; ibase=${_i/*:/}; \$1\" | bc -q + }" + done +done +unset _bases _i _o + Index: ossp-pkg/due/.due/due.fs.sh RCS File: /v/ossp/cvs/ossp-pkg/due/.due/due.fs.sh,v rcsdiff -q -kk '-r1.2' '-r1.3' -u '/v/ossp/cvs/ossp-pkg/due/.due/due.fs.sh,v' 2>/dev/null --- due.fs.sh 2004/10/24 19:10:38 1.2 +++ due.fs.sh 2007/05/24 17:18:30 1.3 @@ -45,3 +45,14 @@ # canonicalization of df(1) output alias df='command df -k' +# convert between Unix/LF and Windows/CRLF +if type -P recode 2>/dev/null; then + # full charset conversion + alias unix2win="recode ISO-8859-1..CP1252/CR-LF" + alias win2unix="recode CP1252/CR-LF..ISO-8859-1" +elif type -P perl 2>/dev/null; then + # sufficient for at least CR/LF conversion + alias unix2win="perl -p -i.orig -e 's/\r?\n/\r\n/sg;'" + alias win2unix="perl -p -i.orig -e 's/\r\n/\n/sg;'" +fi + Index: ossp-pkg/due/.due/due.recue.sh RCS File: /v/ossp/cvs/ossp-pkg/due/.due/Attic/due.recue.sh,v co -q -kk -p'1.2' '/v/ossp/cvs/ossp-pkg/due/.due/Attic/due.recue.sh,v' | diff -u - /dev/null -L'ossp-pkg/due/.due/due.recue.sh' 2>/dev/null --- ossp-pkg/due/.due/due.recue.sh +++ /dev/null 2025-04-11 21:56:46.000000000 +0200 @@ -1,84 +0,0 @@ -## -## OSSP due - Dynamic User Environment -## Copyright (c) 1994-2004 Ralf S. Engelschall -## Copyright (c) 1994-2004 The OSSP Project -## -## This file is part of OSSP due, a dynamic user environment -## which can found at http://www.ossp.org/pkg/tool/due/ -## -## Permission to use, copy, modify, and distribute this software for -## any purpose with or without fee is hereby granted, provided that -## the above copyright notice and this permission notice appear in all -## copies. -## -## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED -## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR -## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF -## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -## SUCH DAMAGE. -## -## due.rescue.sh: DUE module for rescue command -## - -# system rescue facility -function rescue () { - local cmd="$1" - shift - case "$cmd" in - on ) - rescue_time="${1:-10}" - echo "++ scheduling rescue through system reboot in ${rescue_time} minutes" - case $OSTYPE in - FreeBSD* ) - echo "/sbin/shutdown -r now" | at -q r +${rescue_time} minutes >/dev/null - ;; - Linux* ) - echo "/sbin/shutdown -r now" | at -q r +${rescue_time} minutes >/dev/null - ;; - SunOS* ) - echo "/usr/sbin/shutdown -i6 -g0 -y" | at -q r now "+ ${rescue_time}minutes" >/dev/null - ;; - esac - ;; - off ) - echo "++ cancelling rescue through system reboot" - case $OSTYPE in - FreeBSD* ) - for id in `at -q r -l | grep -v "^Date" | awk '{ print $5; }'`; do - at -q r -d $id >/dev/null - done - ;; - Linux* ) - for id in `at -q r -l | awk '{ print $1; }'`; do - at -q r -d $id >/dev/null - done - ;; - SunOS* ) - for id in `at -q r -l | awk '{ print $1; }'`; do - at -r $id >/dev/null - done - ;; - esac - unset rescue_time - ;; - renew|new ) - echo "++ rescheduling rescue through system reboot in ${rescue_time} minutes" - x=${rescue_time} - rescue off >/dev/null || true - rescue on ${x} >/dev/null - ;; - * ) - echo "Usage: rescue on []" 2>&1 - echo "Usage: rescue [re]new" 2>&1 - echo "Usage: rescue off" 2>&1 - ;; - esac -} - Index: ossp-pkg/due/.due/due.rescue.sh RCS File: /v/ossp/cvs/ossp-pkg/due/.due/due.rescue.sh,v co -q -kk -p'1.1' '/v/ossp/cvs/ossp-pkg/due/.due/due.rescue.sh,v' | diff -u /dev/null - -L'ossp-pkg/due/.due/due.rescue.sh' 2>/dev/null --- ossp-pkg/due/.due/due.rescue.sh +++ - 2025-04-11 21:57:12.227188377 +0200 @@ -0,0 +1,84 @@ +## +## OSSP due - Dynamic User Environment +## Copyright (c) 1994-2004 Ralf S. Engelschall +## Copyright (c) 1994-2004 The OSSP Project +## +## This file is part of OSSP due, a dynamic user environment +## which can found at http://www.ossp.org/pkg/tool/due/ +## +## Permission to use, copy, modify, and distribute this software for +## any purpose with or without fee is hereby granted, provided that +## the above copyright notice and this permission notice appear in all +## copies. +## +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## +## due.rescue.sh: DUE module for rescue command +## + +# system rescue facility +function rescue () { + local cmd="$1" + shift + case "$cmd" in + on ) + rescue_time="${1:-10}" + echo "++ scheduling rescue through system reboot in ${rescue_time} minutes" + case $OSTYPE in + FreeBSD* ) + echo "/sbin/shutdown -r now" | at -q r +${rescue_time} minutes >/dev/null + ;; + Linux* ) + echo "/sbin/shutdown -r now" | at -q r +${rescue_time} minutes >/dev/null + ;; + SunOS* ) + echo "/usr/sbin/shutdown -i6 -g0 -y" | at -q r now "+ ${rescue_time}minutes" >/dev/null + ;; + esac + ;; + off ) + echo "++ cancelling rescue through system reboot" + case $OSTYPE in + FreeBSD* ) + for id in `at -q r -l | grep -v "^Date" | awk '{ print $5; }'`; do + at -q r -d $id >/dev/null + done + ;; + Linux* ) + for id in `at -q r -l | awk '{ print $1; }'`; do + at -q r -d $id >/dev/null + done + ;; + SunOS* ) + for id in `at -q r -l | awk '{ print $1; }'`; do + at -r $id >/dev/null + done + ;; + esac + unset rescue_time + ;; + renew|new ) + echo "++ rescheduling rescue through system reboot in ${rescue_time} minutes" + x=${rescue_time} + rescue off >/dev/null || true + rescue on ${x} >/dev/null + ;; + * ) + echo "Usage: rescue on []" 2>&1 + echo "Usage: rescue [re]new" 2>&1 + echo "Usage: rescue off" 2>&1 + ;; + esac +} +