head 1.22; access; symbols SHTOOL_2_0_8:1.22 SHTOOL_2_0_7:1.21 SHTOOL_2_0_6:1.20 SHTOOL_2_0_5:1.20 SHTOOL_2_0_4:1.20 SHTOOL_2_0_3:1.19 SHTOOL_2_0_2:1.19 SHTOOL_2_0_1:1.18 SHTOOL_2_0_0:1.18 SHTOOL_2_0b3:1.18 SHTOOL_2_0b2:1.18 SHTOOL_2_0b1:1.18 SHTOOL_1_6:1.15.0.2 SHTOOL_1_6_2:1.15 SHTOOL_1_6_1:1.15 SHTOOL_1_6_0:1.15 SHTOOL_1_5:1.13.0.2 SHTOOL_1_5_4:1.13 SHTOOL_1_5_3:1.13 SHTOOL_1_5_2:1.13 SHTOOL_1_5_1:1.12 SHTOOL_1_5_0:1.12 SHTOOL_1_4_9:1.12 SHTOOL_1_4_8:1.11 SHTOOL_1_4_7:1.9 SHTOOL_1_4_6:1.8 SHTOOL_1_4_5:1.8 SHTOOL_1_4_4:1.8 SHTOOL_1_4_3:1.8 SHTOOL_1_4_2:1.8 SHTOOL_1_4_1:1.8 SHTOOL_1_4_0:1.8 SHTOOL_1_3_3:1.6 SHTOOL_1_3_2:1.5 SHTOOL_1_3_1:1.4 SHTOOL_1_3_0:1.4 SHTOOL_1_2_9:1.1.1.1 SHTOOL_1_2_8:1.1.1.1 SHTOOL_1_2_7:1.1.1.1 SHTOOL_1_2_6:1.1.1.1 SHTOOL_1_2_5:1.1.1.1 SHTOOL_1_2_4:1.1.1.1 SHTOOL_1_2_3:1.1.1.1 SHTOOL_1_2_2:1.1.1.1 SHTOOL_1_2_1:1.1.1.1 SHTOOL_1_2_0:1.1.1.1 SHTOOL_1_1_0:1.1.1.1 RSE:1.1.1; locks; strict; comment @# @; 1.22 date 2008.04.02.20.13.44; author rse; state Exp; branches; next 1.21; commitid eB5Wirx8MdMyDzXs; 1.21 date 2007.05.19.19.09.39; author rse; state Exp; branches; next 1.20; commitid OPUF1UBbllBTwzis; 1.20 date 2006.02.04.09.43.25; author rse; state Exp; branches; next 1.19; commitid oWk7BmnyAitJtfkr; 1.19 date 2005.06.15.08.14.35; author rse; state Exp; branches; next 1.18; 1.18 date 2004.02.12.16.06.27; author rse; state Exp; branches; next 1.17; 1.17 date 2004.01.01.16.54.20; author rse; state Exp; branches; next 1.16; 1.16 date 2003.02.11.13.00.50; author rse; state Exp; branches; next 1.15; 1.15 date 2001.12.31.15.06.04; author rse; state Exp; branches; next 1.14; 1.14 date 2001.09.23.10.58.10; author rse; state Exp; branches; next 1.13; 1.13 date 2001.01.17.09.55.11; author rse; state Exp; branches; next 1.12; 1.12 date 2000.04.13.13.59.08; author rse; state Exp; branches; next 1.11; 1.11 date 2000.03.12.12.46.42; author rse; state Exp; branches; next 1.10; 1.10 date 2000.03.12.11.12.21; author rse; state Exp; branches; next 1.9; 1.9 date 99.12.24.15.11.23; author rse; state Exp; branches; next 1.8; 1.8 date 99.07.01.15.04.36; author rse; state Exp; branches; next 1.7; 1.7 date 99.07.01.15.02.48; author rse; state Exp; branches; next 1.6; 1.6 date 99.06.29.17.37.34; author rse; state Exp; branches; next 1.5; 1.5 date 99.06.28.15.18.44; author rse; state Exp; branches; next 1.4; 1.4 date 99.06.17.07.35.08; author rse; state Exp; branches; next 1.3; 1.3 date 99.06.12.14.46.37; author rse; state Exp; branches; next 1.2; 1.2 date 99.06.12.14.08.49; author rse; state Exp; branches; next 1.1; 1.1 date 99.04.29.11.19.50; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 99.04.29.11.19.50; author rse; state Exp; branches; next ; desc @@ 1.22 log @adjust copyright for year 2008 @ text @## ## prop -- Display progress with a running propeller ## Copyright (c) 1998-2008 Ralf S. Engelschall ## ## This file is part of shtool and free software; you can redistribute ## it and/or modify it under the terms of the GNU General Public ## License as published by the Free Software Foundation; either version ## 2 of the License, or (at your option) any later version. ## ## This file is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, ## USA, or contact Ralf S. Engelschall . ## str_tool="prop" str_usage="[-p|--prefix ]" arg_spec="0=" opt_spec="p:" opt_alias="p:prefix" opt_p="" . ./sh.common perl='' for dir in `echo $PATH | sed -e 's/:/ /g'` .; do if [ -f "$dir/perl" ]; then perl="$dir/perl" break fi done if [ ".$perl" != . ]; then # Perl is preferred because writing to STDERR in # Perl really writes immediately as one would expect $perl -e ' @@p = ("|","/","-","\\"); $i = 0; while () { printf(STDERR "\r%s...%s\b", $ARGV[0], $p[$i++]); $i = 0 if ($i > 3); } printf(STDERR "\r%s \n", $ARGV[0]); ' "$opt_p" else # But if Perl doesn't exists we use Awk even # some Awk's buffer even the /dev/stderr writing :-( awk ' BEGIN { split("|#/#-#\\", p, "#"); i = 1; } { printf("\r%s%c\b", prefix, p[i++]) > "/dev/stderr"; if (i > 4) { i = 1; } } END { printf("\r%s \n", prefix) > "/dev/stderr"; } ' "prefix=$opt_p" fi shtool_exit 0 ## ## manual page ## =pod =head1 NAME B - B propeller processing indication =head1 SYNOPSIS B [B<-p>|B<--prefix> I] =head1 DESCRIPTION This command displays a processing indication though a running propeller. It is intended to be run at the end of a pipe ("C<|>") sequence where on C logging/processing informations found. For every line on C the propeller advances one step clock-wise. =head1 OPTIONS The following command line options are available. =over 4 =item B<-p>, B<--prefix> I Set a particular prefix I which is displayed in front of the propeller. The default is no prefix string. =back =head1 EXAMPLE # shell script configure 2>&1 |\ tee logfile |\ shtool prop -p "Configuring sources" =head1 HISTORY The B B command was originally written by Ralf S. Engelschall Erse@@engelschall.comE in 1998 for B. It was later taken over into B. =head1 SEE ALSO shtool(1). =cut @ 1.21 log @Adjust copyright for year 2007. @ text @d3 1 a3 1 ## Copyright (c) 1998-2007 Ralf S. Engelschall @ 1.20 log @Adjust copyright for year 2006 @ text @d3 1 a3 1 ## Copyright (c) 1998-2006 Ralf S. Engelschall @ 1.19 log @Adjust copyright for year 2005 @ text @d3 1 a3 1 ## Copyright (c) 1998-2005 Ralf S. Engelschall @ 1.18 log @Embedded the command documentation from shtool.pod into the individual sh.xxxx scripts and this way split the large shtool(1) manual page into individual manual pages shtool-xxxx(1). Submitted partly by: Thomas Lotterer @ text @d3 1 a3 1 ## Copyright (c) 1998-2004 Ralf S. Engelschall @ 1.17 log @Bump copyright year for 2004 @ text @a3 1 ## Originally written for mod_ssl d66 56 @ 1.16 log @Bump year in copyright messages to cover new year 2003. @ text @d3 1 a3 1 ## Copyright (c) 1998-2003 Ralf S. Engelschall @ 1.15 log @bump copyright years @ text @d3 1 a3 1 ## Copyright (c) 1998-2002 Ralf S. Engelschall @ 1.14 log @*** empty log message *** @ text @d3 1 a3 1 ## Copyright (c) 1998-2001 Ralf S. Engelschall @ 1.13 log @*** empty log message *** @ text @d23 1 a23 1 str_usage="[-p]" d26 1 @ 1.12 log @*** empty log message *** @ text @d3 1 a3 1 ## Copyright (c) 1998-2000 Ralf S. Engelschall @ 1.11 log @*** empty log message *** @ text @d50 1 a50 1 # But when Perl doesn't exists we use Awk even @ 1.10 log @*** empty log message *** @ text @d24 1 a24 1 arg_spec="0" @ 1.9 log @*** empty log message *** @ text @d3 1 a3 1 ## Copyright (c) 1998-1999 Ralf S. Engelschall @ 1.8 log @*** empty log message *** @ text @d26 1 @ 1.7 log @*** empty log message *** @ text @d40 2 a41 2 @@p = ("|","/","-","\\"); $i = 0; d52 1 a52 1 BEGIN { d54 3 a56 3 i = 1; } { @ 1.6 log @*** empty log message *** @ text @d42 1 a42 1 while () { d57 1 a57 1 printf("\r%s%c\b", prefix, p[i++]) > "/dev/stderr"; @ 1.5 log @*** empty log message *** @ text @d44 1 a44 1 $i = 0 if ($i > 3); d58 1 a58 1 if (i > 4) { i = 1; } d63 1 a63 1 ' "prefix=$opt_p" @ 1.4 log @*** empty log message *** @ text @d27 1 a27 1 . sh.common @ 1.3 log @*** empty log message *** @ text @d23 1 a23 1 str_usage="[-p]" @ 1.2 log @*** empty log message *** @ text @d2 2 a3 2 ## prop -- Display processing progress with a running propeller ## Copyright (c) 1998-1999 Ralf S. Engelschall, All Rights Reserved. d5 15 @ 1.1 log @Initial revision @ text @a0 1 #!/bin/sh d2 1 a2 1 ## prop -- Display a process indication though a running propeller d4 1 a4 1 ## Usage: prop [-p ] d7 6 a12 14 # # command line parsing # prefix="" while [ ".$1" != . ]; do case $1 in -p ) prefix="$2"; shift; shift; continue ;; * ) break ;; esac done if [ $# -gt 0 ]; then echo "$0:Error: too much arguments" 1>&2 exit 1 fi d32 1 a32 1 ' "$prefix" d48 1 a48 1 ' "prefix=$prefix" @ 1.1.1.1 log @Import of shtool 1.1.0 @ text @@